Fix default receive.timeout

This should be in milliseconds, not seconds. Set the default to be
2 minutes in milliseconds and update the documentation to reflect
that milliseconds are the default unit of time used here.

Change-Id: I50d74e91f4acec2b91daf59a16966cb89045d064
This commit is contained in:
Shawn O. Pearce
2012-03-12 15:52:11 -07:00
parent 1ae8c53498
commit 00dd12d6d1
2 changed files with 9 additions and 6 deletions

View File

@@ -1716,11 +1716,14 @@ Defaults to the number of available CPUs according to the Java runtime.
[[receive.timeout]]receive.timeout::
+
Overall timeout on the time taken to process the change data in received packs.
Only includes the time processing Gerrit changes and updating references, not
the time to index the pack.
Overall timeout on the time taken to process the change data in
received packs. Only includes the time processing Gerrit changes
and updating references, not the time to index the pack. Values can
be specified using standard time unit abbreviations ('ms', 'sec',
'min', etc.).
+
Default is 120 seconds.
Default is 2 minutes. If no unit is specified, millisconds
is assumed.
[[repository]]Section repository

View File

@@ -73,8 +73,8 @@ public class AsyncReceiveCommits implements PreReceiveHook {
long getTimeoutMillis(@GerritServerConfig final Config cfg) {
return ConfigUtil.getTimeUnit(
cfg, "receive", null, "timeout",
TimeUnit.SECONDS.convert(2, TimeUnit.MINUTES),
TimeUnit.SECONDS);
TimeUnit.MINUTES.toMillis(2),
TimeUnit.MILLISECONDS);
}
}