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

Support for shouldSaveResult #29

Open
mrexodia opened this issue Aug 20, 2022 · 3 comments
Open

Support for shouldSaveResult #29

mrexodia opened this issue Aug 20, 2022 · 3 comments

Comments

@mrexodia
Copy link

The upstream version of agenda has a cool feature where it automatically saves the result you return from the job in the database. Not sure how difficult it is to support, but would be nice to have.

@simllll
Copy link
Contributor

simllll commented Aug 23, 2022

Hi @mrexodia
I guess it's not a big deal technically spoken, but I'm not sure if agenda itself should handle this at all.
A job can have other output too, and saving the return value is just one of hundreds use cases. In my opinion the job itself should care about this. There is also another thing that should get considered: saving input and output to the agenda collection itself, makes it even bigger. The goal should be that this collection is as small as possible, save required input and output data to different collections whenever possible. E.g. we create new jobs only with some referenced IDs for the input, instead of the "whole" object that is maybe required for the job.

@mrexodia
Copy link
Author

Yeah I guess that makes sense. My idea was just to save some { id, status, log } because I do not yet know the id of the stored documents. This also gives me a more auditable system where I can follow the data flow from the job (and maybe redo jobs with certain text in their logs later).

I guess the same could be accomplished with the job id as a key, but that requires an additional collection to store info that for me is part of the job execution…

@code-xhyun
Copy link

code-xhyun commented May 4, 2024

It's a very necessary function,so it's supported by shouldSaveResult by Pulse created by forking Agenda.
@mrexodia

Docs - [https://docs-pulse.pulsecron.com/docs/defining-job-processors#parameters]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants