Page MenuHomePhabricator
Paste P1111

adjusting_pull_frequency.txt
ActivePublic

Authored by epriestley on Apr 7 2014, 1:35 PM.
Tags
None
Referenced Files
F140244: adjusting_pull_frequency.txt
Apr 7 2014, 1:35 PM
Subscribers
None
There's a mechanism for adjusting pull frequency, but there's no UI for it and it may not be around for too long after T4605 (most users want to increase the pull frequency). However, it should work for now, and if it stops working later you can yell at us again and we can figure something out. T4605 will introduce smart backoff, and maybe some more controls, so it might sort this out anyway.
In `phabricator_repository.repository`, there's a "details" column which stores a JSON blob. Here's an example:
mysql> select * FROM repository WHERE callsign = 'HGTEST'\G
*************************** 1. row ***************************
id: 3
phid: PHID-REPO-yrujbpx2e5hwifivvsql
name: Mercurial Test
callsign: HGTEST
versionControlSystem: hg
details: {"tracking-enabled":true,"remote-uri":"file:\/\/\/INSECURE\/repos\/hg-private-remote","local-path":"\/INSECURE\/repos\/daemon-HGTEST22","disable-autoclose":false,"pull-frequency":15,"default-branch":"a:b","default-owners-path":"\/","ssh-login":"","ssh-key":"","ssh-keyfile":"","http-login":null,"http-pass":null,"herald-disabled":0,"detail-parser":"PhabricatorRepositoryDefaultCommitMessageDetailParser","serve-over-http":"readwrite","serve-over-ssh":"readwrite","hosting-enabled":true,"importing":false}
dateCreated: 1340674301
dateModified: 1384128195
uuid: NULL
viewPolicy: public
editPolicy: admin
pushPolicy: users
credentialPHID: NULL
1 row in set (0.00 sec)
You can add (or adjust) the "pull-frequency" key, which is measured in seconds. There's no UI for this so you'll have to do it in the database:
- Copy/paste the JSON blob out.
- Add or adjust the value.
- Very carefully, update the row.
Alternatively, you can use some approximation of this script (put it in phabricator/, run with php -f script.php):
<?php
require_once 'scripts/__init_script__.php';
// Replace "EXAMPLE" with the correct callsign.
$repository = id(new PhabricatorRepository())->loadOneWhere('callsign = %s', "EXAMPLE");
// Adjust this, in seconds.
$repository->setDetail('pull-frequency', 60);
$repository->save();
After making either of these changes, restart the daemons.
The pull frequency is advisory, but bumping it up a bunch should result in less daemon activity, at least until T4605.
(Obviously, the cost of this is slower discovery of new commits.)

Event Timeline

epriestley changed the title of this paste from untitled to adjusting_pull_frequency.txt.
epriestley updated the paste's language from autodetect to autodetect.