NicolasLM / spinach

Modern Redis task queue for Python 3
https://spinach.readthedocs.io
BSD 2-Clause "Simplified" License
63 stars 4 forks source link

Non-idempotent jobs do not ever show as exit on a Redis broker #45

Closed 0xDEC0DE closed 3 months ago

0xDEC0DE commented 4 months ago

Steps to reproduce

Prep

In one window:

docker-compose -f spinach/tests/docker-compose.yml up -d
docker-compose -f spinach/tests/docker-compose.yml exec redis redis-cli

Test

In another window:

import spinach
sp = spinach.Engine(spinach.RedisBroker())

@sp.task(name='hi_mom')
def hi_mom():
    print("Hi mom.")

sp.schedule('hi_mom')
sp.start_workers(stop_when_queue_empty=True)

Check

In the first window:

KEYS *

Expected result

An empty result, or an idempotency key.

Actual behavior

A _running-jobs-on-broker-* key is listed in the output. Its contents are the job that just finished, claiming to still be running.

juledwar commented 3 months ago

Can you close this @0xDEC0DE , I don't have the powers.

0xDEC0DE commented 3 months ago

Fixed in #46