Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge benmanns/goworker#85 #3

Closed
wants to merge 16 commits into from
Closed

Merge benmanns/goworker#85 #3

wants to merge 16 commits into from

Conversation

skaurus
Copy link
Owner

@skaurus skaurus commented Jul 26, 2022

Copied from original pull request:

Replaced redigo client with goredis one.

@benmanns what is the significance of GetConn and PutConn ? I've removed them because of redis lib change, but they can be recovered if that's important (using https://pkg.go.dev/github.com/go-redis/redis/[email protected]#Client.Conn).

Fixes benmanns/goworker#69

xescugc and others added 16 commits July 26, 2022 19:52
Mentioning the 1.4 that we'll create is based on master, as the last release is 1.3 and it's old
This logic is ported from the Ruby.

It allows each worker to heartbeat Redis so if everything is killed instead of keeping them on the
DB it'll try to prun them after a while (5').

The only logic ont ported from Ruby is the one about checking the PID.
Otherwise it cannot be imported from the outseide
When redis returns nil they return an error with an specific logic to check it with
…ss fully closed

It's useful when you want to exactly know when the worker has fully stopped and cleaned.

This can be useful in cases in which you have to block something until the worker is closed for example
if the worker is in goroutines and the main process is killed you could end up with workers not beeing
cleaned so using this function would avoid this.
This option is useful to automatically remove retried failed jobs from the 'failed' queue that exceede that duration, this
check will be done every 1m.

Also changed the 'failed.FailedAt' and added 'failed.RetriedAt' and switched them to type string. The main reason is
that the Ruby lib is setting those values in an specific format and Ruby can read multiple formats into one, but GO
cannot and we need to actually use the same ones or the unmarshaler does not work so I decided to switch them to
'string' and add helpers to set/get the values that will directly convert them.

All the logic has more or less been ported from the Ruby version, on how to remove failed jobs and how the data
is stored, as the 'MaxAgeRetries' is something unique from this GO version
This will remove workers thare could be stuck but it's not backwards compatible if enabled
For some reason with previous tests this was not found but now it's fixed
@skaurus skaurus closed this Jul 26, 2022
@skaurus skaurus deleted the cycloidio-master branch July 26, 2022 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

redis please use go-redis
2 participants