Skip to content

Instantly share code, notes, and snippets.

@HackToHell
Created January 17, 2016 09:18
Show Gist options
  • Save HackToHell/b8c73a2c6db53e9881ac to your computer and use it in GitHub Desktop.
Save HackToHell/b8c73a2c6db53e9881ac to your computer and use it in GitHub Desktop.
from flask import Flask
from flask_apscheduler import APScheduler
class Config(object):
JOBS = [
{
'id': 'job1',
'func': '__main__:job1',
'args': (1, 2),
'trigger': 'interval',
'seconds': 10
}
]
SCHEDULER_VIEWS_ENABLED = True
def job1(a, b):
print(a + ' ' + b)
app = Flask(__name__)
app.config.from_object(Config())
app.debug = True
scheduler = APScheduler()
scheduler.init_app(app)
scheduler.start()
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment