Add an ability to schedule jobs to be executed in the future. #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "gitlab-mr-iid-3"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #2
This can be used for scheduled activities pleroma/pleroma#4375
Going to rework this a bit to properly handle entries with the same timestamps.
Edit: Done
The idea is that persistence can be added if needed by creating and plugging in a different store (e.g. mnesia-based).
❤️
Markdown lists style is not consistent: some use
-and some*. I don't care which one we use, but maybe*is better because it's used by Pleroma.Please, make sure all lists have the same symbol.
One
#per line is enough ;)Here and also line 17: need to add a default value
[]toApplication.get_env/3, like this:Otherwise, if there is no configuration, it would fail with
FunctionClauseError.Please, add a default value to
Application.get_env/3.Can you please elaborate on why we need it here?
I think it should be
falseby default. We have another pleroma related project which uses the queue and it doesn't need scheduled jobs.Mainly for tests. What do you think about moving it to
config/test.exs? Feels a bit better than addingApplication.put_envin test files to enable it since it's going to be disabled by defaultPleromaJobQueue.Scheduler.Storebehavior states thatinit/1may also return{:error, error :: any()}.I suggest to wrap it into
withstatement, so a potential store error won't cause aMatchError. Something like this:I see. When you add default values to all
Application.get_envcalls it will work without config (I've just tried and it worked on my machine).Probably you tried it with
enabled: true. Withenabledset tofalseby default, the scheduler doesn't start in tests, so they don't pass. Confirmed it on my machine :)Oh right. :face_palm: Yeah, in this case we need
config :pleroma_job_queue, :scheduler, enabled: truelet's put it inconfig/test.exs.I just updated the CI config in master, it should fix the pipeline.
Hmm,
{:ok, state} = @store.init([])should be{:ok, state} <- @store.init([])otherwise it would still fail withMatchError.Also, please don't force push it's hard to track changes.
Nice catch, done. Re: commit history, sure, noted.
Thanks. I also updated the config so that it doesn't fail in a non-test env
Resolved this. The only place where
-is used is the changelog. This is to be consistent with the Pleroma's changelog.Pull request closed