Derrick Stolee
b08ff1fee0
maintenance: add --schedule option and config
...
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>
2020-09-25 10:59:44 -07:00
..
2020-09-25 10:59:44 -07:00
2020-07-06 22:09:16 -07:00
2020-08-17 17:02:50 -07:00
2020-08-11 18:04:11 -07:00
2019-05-09 00:37:27 +09:00
2020-03-29 09:25:38 -07:00
2019-10-06 12:25:16 +09:00
2020-08-06 14:08:10 -07:00
2017-01-23 10:56:47 -08:00
2020-08-04 18:34:02 -07:00
2020-06-17 21:54:05 -07:00
2020-09-17 11:30:05 -07:00
2020-05-18 13:18:56 -07:00
2019-12-13 12:18:07 -08:00
2019-09-17 12:14:06 -07:00
2020-07-29 13:44:03 -07:00
2020-02-18 13:53:30 -08:00
2016-05-09 15:44:14 -07:00
2020-09-17 11:30:05 -07:00
2019-12-04 10:10:37 -08:00
2020-04-03 11:37:22 -07:00
2018-05-25 17:16:47 +09:00
2018-06-25 13:22:36 -07:00
2018-09-21 09:28:58 -07:00
2014-02-28 09:55:35 -08:00
2019-12-06 15:09:24 -08:00
2020-08-07 15:13:03 -07:00
2019-05-16 11:36:23 +09:00
2020-06-24 09:14:21 -07:00
2020-06-08 18:06:28 -07:00
2020-07-30 09:16:48 -07:00
2020-07-01 15:54:05 -07:00
2019-11-07 13:42:00 +09:00
2020-03-17 15:02:23 -07:00
2018-05-25 17:16:47 +09:00
2019-04-02 13:57:00 +09:00
2020-04-06 13:42:43 -07:00
2020-04-03 11:37:22 -07:00
2013-11-27 12:16:49 -08:00
2011-07-06 14:26:26 -07:00
2019-10-11 14:24:46 +09:00
2020-09-17 11:30:05 -07:00
2018-12-26 15:29:30 -08:00
2020-07-30 13:20:31 -07:00
2020-04-03 11:37:22 -07:00
2020-04-03 11:37:22 -07:00
2020-02-10 10:49:12 -08:00
2016-10-10 13:52:37 -07:00
2014-09-16 11:11:58 -07:00
2018-05-25 17:16:47 +09:00
2020-05-08 14:25:01 -07:00
2020-05-18 13:19:33 -07:00
2013-02-01 13:53:33 -08:00
2016-10-03 13:22:25 -07:00
2019-11-07 13:42:00 +09:00
2019-03-13 11:14:22 +09:00
2019-04-08 17:24:51 +09:00
2011-07-06 14:26:26 -07:00
2018-05-02 17:03:33 +09:00
2019-04-01 15:17:47 +09:00
2020-07-13 12:47:38 -07:00
2019-05-13 23:11:59 +09:00
2020-06-25 14:19:23 -07:00
2020-06-02 13:35:05 -07:00
2018-04-09 14:15:02 +09:00
2020-06-25 09:18:53 -07:00
2020-02-04 12:17:18 -08:00
2018-10-29 10:17:01 +09:00
2020-07-16 10:46:55 -07:00
2020-04-07 22:37:18 -07:00
2011-07-06 14:26:26 -07:00
2019-07-29 10:41:18 -07:00
2019-09-05 13:01:48 -07:00
2015-10-16 15:27:52 -07:00
2020-04-28 15:50:09 -07:00
2019-10-06 09:45:02 +09:00
2019-05-28 10:47:42 -07:00
2020-08-04 18:34:01 -07:00
2019-03-07 09:25:32 +09:00
2020-06-10 18:06:34 -07:00
2018-05-02 17:03:33 +09:00
2018-10-29 10:17:02 +09:00
2020-07-30 21:34:32 -07:00
2013-02-01 13:53:33 -08:00
2020-06-24 09:14:21 -07:00
2019-01-28 10:57:44 -08:00
2019-04-01 15:49:47 +09:00
2020-08-17 17:02:50 -07:00
2020-04-06 13:42:43 -07:00
2020-06-25 09:18:53 -07:00
2019-03-13 11:14:22 +09:00
2016-05-26 13:17:14 -07:00
2016-06-06 11:14:43 -07:00
2020-09-25 10:59:44 -07:00
2019-09-09 11:05:51 -07:00
2015-10-29 12:10:23 -07:00
2019-09-09 11:05:52 -07:00
2011-07-06 14:26:26 -07:00
2013-09-04 15:02:56 -07:00
2020-05-05 16:07:30 -07:00
2019-05-13 23:11:59 +09:00
2019-05-13 23:11:59 +09:00
2015-10-16 15:27:52 -07:00
2018-04-09 14:15:07 +09:00
2020-05-10 09:50:55 -07:00
2016-06-28 08:20:52 -07:00
2018-05-02 17:03:33 +09:00
2020-08-03 12:40:09 -07:00
2020-02-14 08:58:53 -08:00
2020-08-06 13:01:03 -07:00
2011-07-06 14:26:26 -07:00
2013-07-18 16:23:46 -07:00
2011-07-06 14:26:26 -07:00
2017-07-28 14:41:32 -07:00
2014-10-13 13:35:18 -07:00
2018-05-02 17:03:33 +09:00
2020-04-29 16:15:27 -07:00
2019-08-11 17:40:07 -07:00
2019-01-07 15:29:34 -08:00
2019-12-05 12:52:44 -08:00
2020-04-06 13:42:43 -07:00
2020-07-09 14:00:45 -07:00
2019-09-09 11:05:52 -07:00
2018-10-22 13:32:54 +09:00
2019-04-22 11:14:46 +09:00
2019-04-01 14:00:53 +09:00
2019-04-01 14:00:53 +09:00
2019-04-02 13:57:00 +09:00
2019-08-11 17:40:07 -07:00
2019-09-05 13:01:48 -07:00
2018-05-02 17:03:33 +09:00
2019-07-09 15:25:44 -07:00
2020-04-06 13:42:43 -07:00
2020-05-08 14:25:08 -07:00
2020-07-08 22:08:54 -07:00
2019-11-20 10:19:58 +09:00
2020-04-03 11:37:22 -07:00
2020-02-19 10:56:49 -08:00
2019-09-09 11:05:51 -07:00
2018-05-02 17:03:33 +09:00
2012-03-28 11:18:35 -07:00
2011-09-11 21:52:18 -07:00
2016-06-08 12:04:37 -07:00
2018-05-02 17:03:33 +09:00
2019-11-10 15:13:23 +09:00
2019-04-10 12:05:03 +09:00
2020-05-27 10:07:07 -07:00
2019-01-10 10:29:05 -08:00
2018-05-25 17:16:47 +09:00
2020-06-22 15:55:03 -07:00
2014-10-13 13:35:18 -07:00
2020-02-19 10:56:49 -08:00
2019-09-09 11:05:51 -07:00
2015-10-16 15:27:52 -07:00
2020-06-24 09:14:21 -07:00
2019-11-23 09:49:23 +09:00
2020-04-06 13:42:43 -07:00
2012-10-21 12:17:38 -07:00
2019-11-07 13:42:00 +09:00
2017-04-20 22:05:37 -07:00
2011-07-06 14:26:26 -07:00
2016-08-24 12:31:05 -07:00
2020-01-22 12:27:49 -08:00
2020-07-27 10:06:49 -07:00
2019-05-15 14:07:37 +09:00
2015-10-22 10:16:12 -07:00
2019-01-23 11:37:29 -08:00
2018-05-02 17:03:33 +09:00
2016-07-06 13:06:36 -07:00
2015-05-17 11:24:57 -07:00
2017-01-17 16:10:22 -08:00
2019-03-13 11:14:22 +09:00
2013-08-13 09:01:54 -07:00
2020-08-03 21:32:41 -07:00
2011-07-06 14:26:26 -07:00
2020-08-04 18:34:02 -07:00
2020-05-02 18:04:12 -07:00
2020-03-17 15:02:24 -07:00
2020-01-08 08:56:40 -08:00
2020-08-04 18:34:01 -07:00
2017-02-15 12:54:20 -08:00
2018-12-26 14:59:37 -08:00
2020-06-25 09:18:53 -07:00
2020-05-26 09:32:08 -07:00
2017-02-09 15:14:01 -08:00
2020-07-24 13:53:58 -07:00
2019-07-25 14:27:13 -07:00
2019-12-26 11:00:15 -08:00
2020-06-24 09:14:21 -07:00
2016-11-14 11:23:07 -08:00
2020-07-06 22:09:13 -07:00
2019-11-10 18:02:14 +09:00
2018-08-31 14:04:06 -07:00
2020-04-06 13:42:43 -07:00
2019-05-07 13:04:48 +09:00
2019-05-07 13:04:48 +09:00
2019-09-09 11:05:52 -07:00
2019-06-24 12:37:21 -07:00
2020-07-18 13:43:34 -07:00
2019-08-05 10:05:24 -07:00
2014-04-17 11:14:57 -07:00
2017-07-17 15:11:26 -07:00
2017-12-12 16:49:40 -08:00
2014-04-17 11:14:58 -07:00
2015-04-20 11:05:50 -07:00
2016-05-10 11:15:04 -07:00
2013-01-05 23:41:42 -08:00
2020-08-04 18:34:02 -07:00
2020-03-29 09:25:38 -07:00
2020-03-29 09:25:38 -07:00
2019-09-16 12:20:39 -07:00
2020-04-29 16:15:27 -07:00
2019-11-11 11:04:46 +09:00
2020-06-25 09:18:53 -07:00
2020-03-30 11:16:41 -07:00
2020-07-06 22:09:15 -07:00
2019-12-10 13:11:43 -08:00
2020-04-05 15:00:03 -07:00
2020-07-08 22:08:54 -07:00
2020-08-17 17:02:49 -07:00
2020-07-08 22:08:53 -07:00
2019-07-02 12:08:08 -07:00
2020-07-06 22:09:16 -07:00
2017-01-23 10:56:53 -08:00
2019-10-04 09:26:42 +09:00
2016-11-14 11:23:07 -08:00
2015-10-22 10:16:12 -07:00
2019-10-21 12:02:39 +09:00
2020-03-31 16:08:02 -07:00
2020-06-25 09:18:53 -07:00