b08ff1fee0
Maintenance currently triggers when certain data-size thresholds are met, such as number of pack-files or loose objects. Users may want to run certain maintenance tasks based on frequency instead. For example, a user may want to perform a 'prefetch' task every hour, or 'gc' task every day. To help these users, update the 'git maintenance run' command to include a '--schedule=<frequency>' option. The allowed frequencies are 'hourly', 'daily', and 'weekly'. These values are also allowed in a new config value 'maintenance.<task>.schedule'. The 'git maintenance run --schedule=<frequency>' checks the '*.schedule' config value for each enabled task to see if the configured frequency is at least as frequent as the frequency from the '--schedule' argument. We use the following order, for full clarity: 'hourly' > 'daily' > 'weekly' Use new 'enum schedule_priority' to track these values numerically. The following cron table would run the scheduled tasks with the correct frequencies: 0 1-23 * * * git -C <repo> maintenance run --schedule=hourly 0 0 * * 1-6 git -C <repo> maintenance run --schedule=daily 0 0 * * 0 git -C <repo> maintenance run --schedule=weekly This cron schedule will run --schedule=hourly every hour except at midnight. This avoids a concurrent run with the --schedule=daily that runs at midnight every day except the first day of the week. This avoids a concurrent run with the --schedule=weekly that runs at midnight on the first day of the week. Since --schedule=daily also runs the 'hourly' tasks and --schedule=weekly runs the 'hourly' and 'daily' tasks, we will still see all tasks run with the proper frequencies. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> |
||
---|---|---|
.. | ||
add.txt | ||
advice.txt | ||
alias.txt | ||
am.txt | ||
apply.txt | ||
blame.txt | ||
branch.txt | ||
browser.txt | ||
checkout.txt | ||
clean.txt | ||
color.txt | ||
column.txt | ||
commit.txt | ||
completion.txt | ||
core.txt | ||
credential.txt | ||
diff.txt | ||
difftool.txt | ||
extensions.txt | ||
fastimport.txt | ||
feature.txt | ||
fetch.txt | ||
filter.txt | ||
fmt-merge-msg.txt | ||
format.txt | ||
fsck.txt | ||
gc.txt | ||
gitcvs.txt | ||
gitweb.txt | ||
gpg.txt | ||
grep.txt | ||
gui.txt | ||
guitool.txt | ||
help.txt | ||
http.txt | ||
i18n.txt | ||
imap.txt | ||
index.txt | ||
init.txt | ||
instaweb.txt | ||
interactive.txt | ||
log.txt | ||
mailinfo.txt | ||
mailmap.txt | ||
maintenance.txt | ||
man.txt | ||
merge.txt | ||
mergetool.txt | ||
notes.txt | ||
pack.txt | ||
pager.txt | ||
pretty.txt | ||
protocol.txt | ||
pull.txt | ||
push.txt | ||
rebase.txt | ||
receive.txt | ||
remote.txt | ||
remotes.txt | ||
repack.txt | ||
rerere.txt | ||
reset.txt | ||
sendemail.txt | ||
sequencer.txt | ||
showbranch.txt | ||
splitindex.txt | ||
ssh.txt | ||
stash.txt | ||
status.txt | ||
submodule.txt | ||
tag.txt | ||
tar.txt | ||
trace2.txt | ||
transfer.txt | ||
uploadarchive.txt | ||
uploadpack.txt | ||
url.txt | ||
user.txt | ||
versionsort.txt | ||
web.txt | ||
worktree.txt |