示例#1
0
def update_server():
    models.update_server()
示例#2
0
# initialize flask
app = Flask(__name__)
app.debug = DEBUG
app.secret_key = SECRET_KEY


from logger import get_logger

# initialize logger
logger = get_logger(app, SERVICE_NAME, LOG_LEVEL, LOG_FILENAME,
                    MONGODB_HOST, MONGODB_PORT, MONGODB_DB, SERVICE_NAME)

import models
# load app info
models.load_app(force=True)
models.update_server()

# register update server scheduler
from apscheduler.scheduler import Scheduler

scheduler = Scheduler()

# update server infomation
@scheduler.interval_schedule(seconds=UPDATE_INTERVAL)
def update_server():
    models.update_server()

scheduler.print_jobs()
scheduler.start()

import views