upd: Применение скидки в выводе API

This commit is contained in:
2024-02-11 20:10:25 +03:00
parent 5a95b06300
commit 3dbefda936
6 changed files with 56 additions and 28 deletions

View File

@@ -22,12 +22,7 @@ celery_app.conf.beat_schedule = {
}
celery_task_app = Celery(
'tasks', broker='amqp://guest:guest@localhost', backend='rpc://'
)
@celery_task_app.task
@celery_app.task
def periodic_task() -> None:
result = loop.run_until_complete(main())
return result

View File

@@ -26,7 +26,7 @@ async def refresh_cache(disconts: dict):
await redis.flushall()
for key in disconts.keys():
await redis.set(f'DISCONT:{str(key)}', disconts[key])
await redis.set(f'DISCONT:{str(key)}', pickle.dumps(disconts[key]))
await redis.set('XLSX_MOD_TIME', pickle.dumps(os.path.getmtime(file)))