add more logging for NK Auto Import
This commit is contained in:
@@ -39,7 +39,7 @@ from rowers.opaque import encoder
|
|||||||
from rowers.models import User,VirtualRace,Workout
|
from rowers.models import User,VirtualRace,Workout
|
||||||
from rowers.plannedsessions import email_submit_race
|
from rowers.plannedsessions import email_submit_race
|
||||||
from rowers.rower_rules import user_is_not_basic
|
from rowers.rower_rules import user_is_not_basic
|
||||||
|
from rowers.utils import dologging
|
||||||
|
|
||||||
# If you find a solution that does not need the two paths, please comment!
|
# If you find a solution that does not need the two paths, please comment!
|
||||||
sys.path.append('$path_to_root_of_project$')
|
sys.path.append('$path_to_root_of_project$')
|
||||||
@@ -209,6 +209,8 @@ class Command(BaseCommand):
|
|||||||
rowers = Rower.objects.filter(nk_auto_import=True)
|
rowers = Rower.objects.filter(nk_auto_import=True)
|
||||||
for r in rowers: # pragma: no cover
|
for r in rowers: # pragma: no cover
|
||||||
if user_is_not_basic(r.user):
|
if user_is_not_basic(r.user):
|
||||||
|
s = 'Starting NK Auto Import for user {id}'.format(id=r.user.id)
|
||||||
|
dologging('nklog.log',s)
|
||||||
res = nkstuff.get_nk_workouts(r)
|
res = nkstuff.get_nk_workouts(r)
|
||||||
|
|
||||||
messages = Message.objects.filter(mailbox_id = workoutmailbox.id)
|
messages = Message.objects.filter(mailbox_id = workoutmailbox.id)
|
||||||
|
|||||||
@@ -148,6 +148,8 @@ def get_nk_workouts(rower, do_async=True,before=0,after=0):
|
|||||||
|
|
||||||
knownnkids = uniqify(knownnkids+tombstones+parkedids)
|
knownnkids = uniqify(knownnkids+tombstones+parkedids)
|
||||||
newids = [nkid for nkid in nkids if not nkid in knownnkids]
|
newids = [nkid for nkid in nkids if not nkid in knownnkids]
|
||||||
|
s = 'New NK IDs {newids}'.format(newids=newids)
|
||||||
|
dologging('nklog.log',s)
|
||||||
|
|
||||||
newparkedids = uniqify(newids+parkedids)
|
newparkedids = uniqify(newids+parkedids)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user