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 #89

Closed
wants to merge 32 commits into from
Closed

Conversation

skaurus
Copy link

@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 #69

xescugc and others added 30 commits June 7, 2021 11:02
Mentioning the 1.4 that we'll create is based on master, as the last release is 1.3 and it's old
CHANGELOG: Stareted the CHANGELOG
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.
Added: Worker logic for heatbeat and prune
CHANGELOG: Bump verison 0.1.5
From the original 'github.com/benmanns/goworker' to the cycloid maintained fork
mod: Update the module definition
Otherwise it cannot be imported from the outseide
CHANGELOG: Quick release to change the module definition
When redis returns nil they return an error with an specific logic to check it with
worker: Fix issue with go-redis syntax
…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.
 goworker: Added a function 'Closed()' that will return when the process fully closed
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
Added: '-force-prune' to remove workers not on the heartbeat list
For some reason with previous tests this was not found but now it's fixed
@skaurus skaurus closed this Jul 26, 2022
@skaurus
Copy link
Author

skaurus commented Jul 26, 2022

Sorry, wrong repo :(

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