clj-commons / clj-commons/durable-queue

calling complete! on already completed task messes up stats

Open
#3 2 comments 0 reactions 1 assignee Claimed by @seancorfield View on GitHub
needs analysis
Dominant language
Clojure
Stars
405
Forks
30
PR merge metrics
No merged PRs in 30d

Description

I'm not sure if this is as expected, but I found this behavior when I was trying stuff in REPL.

``` clojure
> (dq/put! q :test "test task")
> (def t (dq/take! q :test))
> (dq/complete! t)
true
> (get (dq/stats q) "test")
{:in-progress 0, :completed 1, :retried 0, :enqueued 1, :num-slabs 1, :num-active-slabs 1}
> (dq/complete! t)
true
> (get (dq/stats q) "test")
{:in-progress -1, :completed 2, :retried 0, :enqueued 1, :num-slabs 1, :num-active-slabs 1}
```

Is this expected behavior and the caller is responsible of keeping track of task status?
If so, is there possibility of making status function public, so that we can check the status of the task?(currently it's private)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.