RichardKnop / machinery

Machinery is an asynchronous task queue/job queue based on distributed message passing.
Mozilla Public License 2.0
7.52k stars 914 forks source link

Lock interface & Context argument #803

Open agcom opened 6 months ago

agcom commented 6 months ago

The Redis-lock methods do not receive a context argument; the merged PR #652 did a trick of passing the Redis client's context to its own methods' calls, which I strongly doubt its impact. Moving on, go-redis was updated to v9 on #793; the new client removed access to its maybe internal context; therefore, the below line was commented. https://github.com/RichardKnop/machinery/blob/0c29c70ce38d85464145df8455c3ccca5d605b59/v1/locks/redis/redis.go#L68

I guess that the lock interface methods should receive a context argument to possibly cancel the lock operation, specially in case the Redis calls take too much time; what are your thoughts?