Skip to content

Commit

Permalink
chore: ensure MEDIA_ROOT DIR is created on rq worker startup
Browse files Browse the repository at this point in the history
  • Loading branch information
ukanga committed Jan 8, 2025
1 parent 3d5e68b commit 9a0a5e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/jobs/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
with Connection():
if settings.SENTRY_DSN:
sentry_sdk.init(settings.sentry_dsn, integrations=[RqIntegration()])

if not os.path.isdir(settings.MEDIA_ROOT):
os.mkdir(settings.MEDIA_ROOT)

queue = Queue(QUEUE_NAME, connection=redis_conn)

w = Worker(queue, connection=redis_conn)
Expand Down

0 comments on commit 9a0a5e0

Please sign in to comment.