denshoproject / ddr-local

Web UI used for interacting with DDR collections and entities on a local machine.
Other
3 stars 0 forks source link

where does celerybeat keep gitstatus-queue? #196

Closed gjost closed 6 years ago

gjost commented 8 years ago

gfroh:

Through the webui, the link from the collection detail page to git status throws an error. And, the "sync status" indicator is also not displaying the current status or the sync button -- just a gray label.

The centralized sync status file at the default location (.../gold/tmp/ddr-janm-6.status) is not present so that would explain why it's not working.

Can't remember how/when the file should be generated. And why it might not be generated as expected.

Which machine is responsible for maintaining the status? And what is the process again? I'd like to get this well-documented for hq.

gjost commented 8 years ago

tmp/*.status cache files are generated by the celerybeat task. tmp/gitstatus-queue tracks which collections to check next.

There are two Celery tasks that run on a single-seat ddr-local:

Celerybeat is a separate task managed by Supervisor that runs this command: /usr/local/src/ddr-local/ddrlocal/manage.py celery beat -S

Celerybeat runs ddrlocal.webui.gitstatus.update_store, which does the actual update. There is a bunch of celery config in settings.py that instructs the celerybeat app to hit that particular gitstatus function.

On a single-seat ddr-local, celerybeat is set up when you run make enable-bkgnd. In the HQ it's best if there is only one celerybeat running, though the gitstatus code I wrote does do some locking.

gjost commented 8 years ago

On dragontail in the HQ, looks like .../gold/tmp/gitstatus-queue is old. There are *.status present in that dir which are newer. This suggests that whichever machine is actually running celerybeat is writing gitstatus-queue somewhere else.

gjost commented 8 years ago

settings.GITSTATUS_QUEUE_PATH governs where the queue is written. This is MEDIA_URL + .gitstatus-queue. On my dev this is /var/www/media/ddr/.gitstatus-queue.