Add configurable cron schedule #116
Labels
No Label
Roadmap
V
bug
docs
duplicate
enhancement
good first issue
help wanted
idea
invalid
question
wontfix
Idea
Roadmap
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vieter-v/vieter#116
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Some people might want their packages to be rebuilt more or less frequently, or at a different time.
It might be useful to implement our own simple version of cron which in essence would check whether it can start the builds every minute or so. This might open up opportunities to allow granular configuration of build timings for specific repos.
Writing our own cron daemon could be done using the following:
At some point, the daemon should also update the queue with the new list of repos, to make sure we keep up to date with the settings.
To schedule jobs & periodically update the API, I have the following algorithm in mind:
We add a configuration variable
api_update_frequency
or something that defines how often the API should be contacted for updates, in minutes.I also had some ideas for implementing concurrent builds. At startup, we could store a fixed-length array of threads that will be empty in the beginning, with the length being defined by a
max_concurrent_builds
variable. When we wish to schedule a job, we search for the next slot in the array that is either empty or contains a thread that has already finished. If none are present, we sleep for a certain amount of time before trying again.Apparently there's no function for only checking whether a thread has finished; you can only wait. Perhaps we could use a shared object instead that each thread then updates whenever it's done with a build.
this snippet, courtesy of spytheman#4818 in the vlang discord, could solve our problems. We could use more than 2 values because it's a u64, so 0 could mean 'free', 1 means 'running' & 2 means 'done' or something.