Skip to content

Commit

Permalink
scheduler fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffVandrewJr committed Jan 30, 2019
1 parent cc11484 commit bba1306
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/qbo.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,9 @@ def set_global_vars(realmid, code):
save('refresh_token', refresh_token)
save('session_manager', session_manager)
save('qbclient', qbclient)
mins = int(app.config.get('REFRESH_MINS'))

@scheduler.task('interval', id='do_refresh', minutes=50)
@scheduler.task('interval', id='do_refresh', minutes=mins)
def refresh():
with scheduler.app.app_context():
if fetch('refresh_token') is not None:
Expand Down
1 change: 1 addition & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ class Config(object):
SCHEDULER_JOBSTORES = {
'default': RedisJobStore(host=REDIS_HOST)
}
REFRESH_MINS = os.environ.get('REFRESH_MINS') or 50

0 comments on commit bba1306

Please sign in to comment.