520e931211
* feat(backgroundjobs): add new background jobs module for file imports queueing * fix(fileuploads): a merge gone wrong * feat(backgroundjobs): rename rhino queue env var * test(backgroundjob): use deep equal claude * fix(fileuploads): sync PR review * feat(ifc_importer): initial importer app implementation with a sleeping worker * chore(pre-commit): remove black as a formatter, its now handled by ruff * fix(ifc-importer): better handling of max job attempt * feat(eslint): ignore package from eslint
21 lines
474 B
Python
21 lines
474 B
Python
import asyncio
|
|
|
|
from ifc_importer.job_processor import job_processor
|
|
|
|
|
|
async def main():
|
|
task = asyncio.create_task(job_processor())
|
|
|
|
# we do not need any sort of signal handling logic,
|
|
# cause if the context of the job transaction exits,
|
|
# the job gets back into a queue-d state
|
|
try:
|
|
await task
|
|
except Exception as ex:
|
|
print(f"Execution failed with exception {ex}")
|
|
raise
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|