-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Non-numeric identifier for run individual task #33
Comments
Hello, I thinking about that in the past and I'm not against it, out of curiosity what is your use case? |
My use case for this is I need to run some jobs on multiple servers/containers. I have worker processes pulling from a Redis queue. |
I second that.
|
OK guys, would you consider sponsoring (financially) this feature? |
Not really. :( |
@jszczypk You can also create a PR :) |
I will. :) |
For my Crunz-ui repository I needed a unique identifier for each task and I used a system like this:
This method is a bit rustic but it worked in my case. The contraindication is that if the event changes the description or configuration of the execution moment or the path within the folder where the tasks are contained, the event changes its unique id. However, it works better than the id obtained from the getId() function which essentially changes every time a new event is added. If you have better suggestions, they would help me too. |
@PabloKowalczyk, I would like to introduce, in the Event Class, a method to obtain a unique non-numeric identifier for the task that does not change even if new tasks are inserted. I tested getId() method but the returned value changes every time new tasks are inserted. I would like to use a similar method as shown before. I would like to use the result of getExpression() method and the content of 'description' variable as parameters for calculating the unique key. However, I need another parameter that allows me to uniquely identify the event (with these two parameters only I risk calculating the same ID for two tasks with the same description and the same launch date and time maybe in different subdir in tasks directory). Do you think this could be a good idea? |
@lucatacconi I think it may work, feel free to open PR :) Next step, after "stable ids", can be user-provided ids, but this needs more work. |
Description
Currently we can run individual task only using dynamic numeric id
-t, --task=TASK Which task to run. Provide task number from schedule:list command.
Which does not guarantee that it does the same task every time.
What do you think for introduce non-numeric identifier which can be used alongside with numeric id for run command in more predictable way?
Example
Usage:
Run
schedule:run --task=backup
List
crunz schedule:list
The text was updated successfully, but these errors were encountered: