upgrade wakatime-cli to v10.2.4

This commit is contained in:
Alan Hamlett
2018-09-20 22:29:34 -07:00
parent f61a34eda7
commit 360a491cda
13 changed files with 319 additions and 142 deletions

View File

@@ -15,6 +15,7 @@ import os
from time import sleep
from .compat import json
from .constants import DEFAULT_SYNC_OFFLINE_ACTIVITY, HEARTBEATS_PER_REQUEST
from .heartbeat import Heartbeat
@@ -104,19 +105,23 @@ class Queue(object):
def pop_many(self, limit=None):
if limit is None:
limit = 5
limit = DEFAULT_SYNC_OFFLINE_ACTIVITY
heartbeats = []
count = 0
while limit == 0 or count < limit:
while count < limit:
heartbeat = self.pop()
if not heartbeat:
break
heartbeats.append(heartbeat)
count += 1
if count % HEARTBEATS_PER_REQUEST == 0:
yield heartbeats
heartbeats = []
return heartbeats
if heartbeats:
yield heartbeats
def _get_db_file(self):
home = '~'