From dc1bd88f3ac5e92b7b4aef3df6b591ca1f116140 Mon Sep 17 00:00:00 2001 From: Ben Ennis Date: Thu, 1 Oct 2015 15:33:54 -0700 Subject: [PATCH] added looping functionality --- librarian/utils/import_daemon.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/librarian/utils/import_daemon.py b/librarian/utils/import_daemon.py index f072a491..6103b3b1 100644 --- a/librarian/utils/import_daemon.py +++ b/librarian/utils/import_daemon.py @@ -67,8 +67,12 @@ def check_for_updates(app): for file in file_list: args=(archive, file, config) app.exts.tasks.schedule(add_file, args=args) + app.exts.tasks.schedule(schedule_check, args=(app,), kwargs={'delay': 600}) + + +def schedule_check(app, delay=10): + app.exts.tasks.schedule(check_for_updates, args=(app,), delay=delay) def daemon(app): - app.exts.tasks.schedule(check_for_updates, args=(app,), delay=10, - periodic=False) + schedule_check(app, delay=15)