Mantilogs Bug Fixes and Figuring out Django-Celery-Beat

Mantilogs Bug Fixes and Figuring out Django-Celery-Beat

Somehow I deleted a line from the Micrologs form code and the payload was being sent malformed. It was an easy fix, thankfully. I just had to replace the line that sent the gecko ID with the payload. Back down to zero bug reports, hooray. I fixed it, made a commit and released a hotfix.

Now with that done I am back to my Jake-O-Lantern core server code.

I've modeled the animations and the playlists fairly easily and hit my first snag around the schedule models. I need to have a scheduled task system or task queuing system like Celery. But I need the tasks to be accessible as a model to be serialized by DRF. I found one promising library, Django Celery Beat, but it will require some research to see if it actually will do what I need or not.

I have had some experience with all of these packages but not very much, Celery I remember being frustrating to get up and running from the documentation and DCB I have no recollection of whatsoever, though I do know I used it for a project. I believe it was my Bug rancher project, if memory serves. I didn't use it with DRF however, so I will have to look around and do some research now...

I can't seem to find anything on cursory glance at documentation and google. I'll need to dig deeper I suppose.

I suspect I may need to roll my own solution here. It would have to spin up a subprocess, create, edit or delete cronjobs. How would I handle reporting though? Hmm...

Celery always feels like it's way more than I need, all I really need is a way to trigger jobs on a schedule.

Ah, from what I have seen at this point Celery Beat doesn't support my current Django version anyway. I did find something that might just do the job however.

GitHub - chrisspen/django-chroniker: Easily control cron jobs through Django’s admin.
Easily control cron jobs through Django’s admin. Contribute to chrisspen/django-chroniker development by creating an account on GitHub.

Now to do a little digging on this one.

Maybe, not sure. I'll have to look through the code or set it up and see apparently, no screenshots or demos.

I've used Django Q before, that worked pretty well but it seems to have died.

GitHub - Koed00/django-q: A multiprocessing distributed task queue for Django
A multiprocessing distributed task queue for Django - GitHub - Koed00/django-q: A multiprocessing distributed task queue for Django

Huh, seems Chroniker doesn't like to do many tasks at once. If I want to have a bunch of light nodes update simultaneously this won't do. Looks like I will have to work with Celery after all.

Maybe the information about it not working with current Django is outdated, eh?

I guess the next steps here for this project are

  • Install and configure DRF with a better JWT solution. (Will also add this to Mantilogs later on.)
  • Install and configure Celery and Celery Beat.
  • Hope it works.

Then I can get on to the serialization, endpoints, and what I presume will be the biggest pain in the ass, creating and managing scheduled jobs from incoming JSON data.

Before that though, gonna get some lunch, maybe a shower.

Actually, probably going to need to get a bath-tank built for a gecko today, so I will probably push this back to tomorrow. Gotta give a little lady a calcium bath.

Welp. Clocking out, I guess? Gonna get that done before I take a shower so it's ready to go this evening.