mirror of
https://github.com/DarkflameUniverse/NexusDashboard.git
synced 2025-04-29 17:46:22 +00:00
fix reports app context
This commit is contained in:
parent
2e82f94b9d
commit
b829d666c9
@ -37,9 +37,10 @@ def uscore_by_date(date):
|
|||||||
|
|
||||||
@scheduler.task("cron", id="gen_item_report", hour=23, timezone="UTC")
|
@scheduler.task("cron", id="gen_item_report", hour=23, timezone="UTC")
|
||||||
def gen_item_report():
|
def gen_item_report():
|
||||||
|
with scheduler.app.app_context():
|
||||||
try:
|
try:
|
||||||
current_app.logger.info("Start Item Report Generation")
|
current_app.logger.info("Start Item Report Generation")
|
||||||
with scheduler.app.app_context():
|
|
||||||
date = datetime.date.today().strftime('%Y-%m-%d')
|
date = datetime.date.today().strftime('%Y-%m-%d')
|
||||||
report = Reports.query.filter(Reports.date==date).filter(Reports.report_type=="items").first()
|
report = Reports.query.filter(Reports.date==date).filter(Reports.report_type=="items").first()
|
||||||
|
|
||||||
@ -85,9 +86,10 @@ def gen_item_report():
|
|||||||
|
|
||||||
@scheduler.task("cron", id="gen_currency_report", hour=23, timezone="UTC")
|
@scheduler.task("cron", id="gen_currency_report", hour=23, timezone="UTC")
|
||||||
def gen_currency_report():
|
def gen_currency_report():
|
||||||
|
with scheduler.app.app_context():
|
||||||
try:
|
try:
|
||||||
current_app.logger.info("Start Currency Report Generation")
|
current_app.logger.info("Start Currency Report Generation")
|
||||||
with scheduler.app.app_context():
|
|
||||||
date = datetime.date.today().strftime('%Y-%m-%d')
|
date = datetime.date.today().strftime('%Y-%m-%d')
|
||||||
report = Reports.query.filter(Reports.date==date).filter(Reports.report_type=="currency").first()
|
report = Reports.query.filter(Reports.date==date).filter(Reports.report_type=="currency").first()
|
||||||
|
|
||||||
@ -127,9 +129,10 @@ def gen_currency_report():
|
|||||||
|
|
||||||
@scheduler.task("cron", id="gen_uscore_report", hour=23, timezone="UTC")
|
@scheduler.task("cron", id="gen_uscore_report", hour=23, timezone="UTC")
|
||||||
def gen_uscore_report():
|
def gen_uscore_report():
|
||||||
|
with scheduler.app.app_context():
|
||||||
try:
|
try:
|
||||||
current_app.logger.info("Start U-Score Report Generation")
|
current_app.logger.info("Start U-Score Report Generation")
|
||||||
with scheduler.app.app_context():
|
|
||||||
date = datetime.date.today().strftime('%Y-%m-%d')
|
date = datetime.date.today().strftime('%Y-%m-%d')
|
||||||
report = Reports.query.filter(Reports.date==date).filter(Reports.report_type=="uscore").first()
|
report = Reports.query.filter(Reports.date==date).filter(Reports.report_type=="uscore").first()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user