cic-internal-integration/apps/cic-eth/cic_eth/admin/debug.py

26 lines
499 B
Python
Raw Normal View History

# standard imports
2021-02-01 18:12:51 +01:00
import datetime
# external imports
2021-02-01 18:12:51 +01:00
import celery
# local imports
from cic_eth.db.models.debug import Debug
from cic_eth.db.models.base import SessionBase
from cic_eth.task import CriticalSQLAlchemyTask
2021-02-01 18:12:51 +01:00
celery_app = celery.current_app
@celery_app.task(base=CriticalSQLAlchemyTask)
def alert(chained_input, tag, txt):
session = SessionBase.create_session()
o = Debug(tag, txt)
session.add(o)
session.commit()
session.close()
return chained_input