-
-
Notifications
You must be signed in to change notification settings - Fork 349
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
[feature] add worker task serialization logic #2989
[feature] add worker task serialization logic #2989
Conversation
internal/messages/messages_test.go
Outdated
data: toJSON(map[string]any{ | ||
"ap_object_type": ap.ObjectNote, | ||
"ap_activity_type": ap.ActivityCreate, | ||
"gts_model": json.RawMessage(toJSON(>smodel.Status{ID: "69", Content: "hehe"})), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably worth taking a whole status from the testrig for this, with all the funky fields a whole status includes, and ensure that serializes/deserializes as expected. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated to use testrig models here: 2fda9bc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
though had to switch to using "google/cmp" instead of "testify" for the test comparisons as testify doesn't handle complex types very well like RSA keys :p
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be doubly sure i added a check to ensure account public / private keys are preserved (as those are the most likely to get bodged during json serialization): d4315aa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I've got a few questions about ser/des but that's it :)
…rring of ALL of it
c1db6d8
to
7201bae
Compare
Looks good to me now :) if you're happy then squerge away |
Description
Adds necessary serialization / deserialization logic to the different worker message / task types for persisted work queues on startup / shutdown. Also adds a very barebones WorkerTask{} type that will be later filled out + used to store them in the database.
Checklist
Please put an x inside each checkbox to indicate that you've read and followed it:
[ ]
->[x]
If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).
go fmt ./...
andgolangci-lint run
.