Skip to content

Commit

Permalink
sync activities 1x/day
Browse files Browse the repository at this point in the history
  • Loading branch information
rustybrooks committed Dec 10, 2024
1 parent d69c24e commit 2f52852
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/api/bikes/management/commands/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
logger = logging.getLogger(__name__)


# interval = (60 * 10)
interval = 60 * 60 * 24


class Command(BaseCommand):
def add_arguments(self, parser):
pass
Expand Down Expand Up @@ -42,6 +46,6 @@ def handle(self, *args, **options):
logger.exception("Failed to retrieve activities")

took = time.time() - t1
diff = (60 * 10) - took
diff = interval - took
print(f"sleeping {diff:0.1f} seconds (took {took:0.1f} seconds)")
time.sleep(diff)

0 comments on commit 2f52852

Please sign in to comment.