Staffjoy / suite

Staffjoy V1, aka "Suite" - a scheduling application for hundreds of workers
https://www.staffjoy.com
Other
842 stars 231 forks source link

Getting mobius to consume the queue? #45

Open uvesten opened 7 years ago

uvesten commented 7 years ago

Short question, grateful for any pointers in the right direction.

I've managed to get suite up and running using docker-compose (and some manual wrangling). Can create users, roles, the whole shebang. Seems to work as it should.

However, I can't get mobius to consume any tasks from the queue.

Steps:

  1. Get suite up and running, create a sudo user and create an API key.
  2. Create some shifts
  3. Configure mobius (self-hosted) with the API key, start server.sh. Polling commences.
  4. Call cron to enqueue tasks. Works.

    {
      "schedules_created": 0,
      "schedules_queued_mobius": 12
    }

... However, nothing gets picked up by mobius. It just keeps reporting

2017-04-21T08:08:22 mobius-dev mobius DEBUG No task found. Sleeping.
2017-04-21T08:08:27 mobius-dev mobius DEBUG No task found. Sleeping.

And in /euler i just see a lot of entries like the one below.

img 2017-04-21 at 08 10 58

Is there something I'm missing? (On the main instance I see a lot of celery processes, so I guess the queue should be up.) Something more I need to do to get mobius to pick up the tasks?

Best regards, / uvesten

philipithomas commented 7 years ago

Hmm, did you see the Self-Hosting part of the Mobius README, which was added in the last couple weeks? https://github.com/staffjoy/mobius-assignment

The odd thing seems to be that it is hitting the endpoint. Is it possible that you wiped the database in development but didn't flush redis? I would try a DELETE call to /api/v2/internal/caches/ to flush Redis

https://github.com/Staffjoy/suite/blob/master/app/apiv2/internal/caches/caches.py#L16

uvesten commented 7 years ago

Thanks for the feedback! Yes, I read about self-hosting, and I got it set up, so it's definitely polling the endpoint. Flushing redis made no difference, I guess I might have to dig deeper.

By the way, should an API key that I made for a sudo user have access to all tasks in the system? Or do I need to set up some special "system-wide" api key for mobius to use?

philipithomas commented 7 years ago

API keys get the permissions of the user. Sudo users have global access, so an API key from that account has system-wide access.