1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 09:42:41 +01:00
phorge-phorge/src/applications/repository
epriestley c402d7d307 Implement smart waits for rarely updated repositories
Summary:
Ref T4605. When figuring out how long to wait to update a repository, factor in when it was last pushed. For rarely updated repositories, wait longer between updates.

(A slightly funky thing about this is that empty repos update every 15 seconds, but that seems OK for the moment.)

Test Plan:
Ran `bin/phd debug pulllocal` and saw sensible calculations and output:

```
...
<VERB> PhabricatorRepositoryPullLocalDaemon Last commit to repository "rPOEMS" was 1,239,608 seconds ago; considering a wait of 6,198 seconds before update.
>>> [79] <query> SELECT * FROM `repository` r   ORDER BY r.id DESC
<<< [79] <query> 514 us
>>> [80] <query> SELECT * FROM `repository_statusmessage` WHERE statusType = 'needs-update'
<<< [80] <query> 406 us
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rINIH" is not due for an update for 8,754 second(s).
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rDUCK" is not due for an update for 14 second(s).
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rMTESTX" is not due for an update for 21,598 second(s).
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rQWER" is not due for an update for 14 second(s).
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rBT" is not due for an update for 13 second(s).
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rSVNX" is not due for an update for 21,598 second(s).
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rINIG" is not due for an update for 13 second(s).
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rHGTEST" is not due for an update for 21,598 second(s).
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rBTX" is not due for an update for 14 second(s).
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rGX" is not due for an update for 13 second(s).
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rMTX" is currently updating.
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rPOEMS" is not due for an update for 6,198 second(s).
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rPHU" is currently updating.
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rSVN" is not due for an update for 21,598 second(s).
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rPHY" is currently updating.
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rGTEST" is not due for an update for 21,598 second(s).
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rINIS" is not due for an update for 6,894 second(s).
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rARCLINT" is not due for an update for 21,599 second(s).
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rLPHX" is not due for an update for 1,979 second(s).
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rARC" is not due for an update for 1,824 second(s).
<VERB> PhabricatorRepositoryPullLocalDaemon Repository "rINIHG" is not due for an update for 21,599 second(s).
...
```

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T4605

Differential Revision: https://secure.phabricator.com/D8782
2014-04-16 13:01:04 -07:00
..
application Ship "Repositories" create button to new Diffusion workflow 2013-10-29 15:32:39 -07:00
conduit Use "\z" instead of "$" to anchor validating regular expressions 2014-03-13 12:42:41 -07:00
constants Build an early multi-step repository create form 2013-07-14 07:37:17 -07:00
controller Fix Create New Repository link on Repositories 2014-02-16 20:12:09 -08:00
customfield Add a "tags" field to Diffusion commit 2014-03-12 11:30:52 -07:00
daemon Implement smart waits for rarely updated repositories 2014-04-16 13:01:04 -07:00
data Allow Git and Mercurial repositories to be cloned with names in the URI 2014-01-30 11:42:25 -08:00
editor Minor, fix a constant in PhabricatorRepositoryEditor 2014-03-26 10:45:48 -07:00
engine Make discovery slightly cheaper in the common case 2014-04-16 13:00:38 -07:00
mail Allow users to receive email about pushes via Herald 2014-03-26 13:51:15 -07:00
management Separate repository updates from the pull daemon 2014-04-16 13:00:29 -07:00
phid Differential - modernize "Local Commits" table 2014-04-02 13:18:11 -07:00
query Provide an "event" page for push logs, which shows details on all events in a given push 2014-03-26 13:51:09 -07:00
response Accept and route VCS HTTP requests 2013-10-29 15:32:40 -07:00
search Various linter fixes. 2014-02-26 12:44:58 -08:00
storage Herald - fix change type bug 2014-04-08 11:58:28 -07:00
worker Make task queue more robust against long-running tasks 2014-04-15 08:42:02 -07:00
PhabricatorRepositoryConfigOptions.php Raise a setup warning for missing or invalid local repository directory 2013-10-30 13:07:09 -07:00