gc: no waiting to play it again
commitaf1a8bbe9c2906c4834fb35a93e94a16289cbf50
authorKyle J. McKay <mackyle@gmail.com>
Wed, 13 Dec 2017 01:43:11 +0000 (12 17:43 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Wed, 13 Dec 2017 01:43:11 +0000 (12 17:43 -0800)
treea8e685c750a9abdfc717a44c64ec79e29628df5d
parent822e4edb7599b493caaa01c47228756aba7a51f5
gc: no waiting to play it again

Although extremely unlikely, when a "mini" garbage collection gets
performed, the end result could be to trigger a normal full garbage
collection.  This can only happen if the "mini" garbage collection
was unable to sufficiently reduce the total number of pack files.

Up until now, what this meant was that the newly triggered full
garbage collection would not run until the next time garbage
collection was performed by running the gc.sh script again on that
same project.

For users of the jobd.pl "--all-once" option this could potentially
be a bad thing, perhaps even a very bad thing.

For users of the projtool.pl "gc" command it's more of an annoyance
when it happens requiring the command to be run again.

If the gitweb.lastgc value was set before running gc.sh then gc.sh
completes successfully and now gitweb.lastgc is unset we need to
run gc.sh one more time.

Address this by making jobd.pl and projtool.pl run gc.sh one more
time for the same project under these circumstances.

For jobd.pl it will just be added to the end of the job queue
whereas projtool.pl will do it immediately since it has no queue.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
jobd/jobd.pl
toolbox/projtool.pl