Fossil SCM
Add the "max-loadavg" setting to the "setting" command. Add "setting" and "unset" to the "all" command so that max-loadavg can be quickly changed on all repos of a large server installation.
Commit
1847552c9239682f937d4905980d7c71ebd0fba8
Parent
1707129a8744a7d…
2 files changed
+17
+8
+17
| --- src/allrepo.c | ||
| +++ src/allrepo.c | ||
| @@ -65,10 +65,16 @@ | ||
| 65 | 65 | }else{ |
| 66 | 66 | blob_appendf(pExtra, " --%s \"\"", zArg); |
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | +static void collect_argv(Blob *pExtra, int iStart){ | |
| 71 | + int i; | |
| 72 | + for(i=iStart; i<g.argc; i++){ | |
| 73 | + blob_appendf(pExtra, " %s", g.argv[i]); | |
| 74 | + } | |
| 75 | +} | |
| 70 | 76 | |
| 71 | 77 | |
| 72 | 78 | /* |
| 73 | 79 | ** COMMAND: all |
| 74 | 80 | ** |
| @@ -118,10 +124,15 @@ | ||
| 118 | 124 | ** present, are passed along verbatim. The --force and |
| 119 | 125 | ** --randomize options are not supported. |
| 120 | 126 | ** |
| 121 | 127 | ** sync Run a "sync" on all repositories. Only the --verbose |
| 122 | 128 | ** option is supported. |
| 129 | +** | |
| 130 | +** setting Run the "setting", "set", or "unset" commands on all | |
| 131 | +** set repositories. These command are particularly useful in | |
| 132 | +** unset conjunection with the "max-loadavg" setting which cannot | |
| 133 | +** otherwise be set globally. | |
| 123 | 134 | ** |
| 124 | 135 | ** Repositories are automatically added to the set of known repositories |
| 125 | 136 | ** when one of the following commands are run against the repository: |
| 126 | 137 | ** clone, info, pull, push, or sync. Even previously ignored repositories |
| 127 | 138 | ** are added back to the list of repositories by these commands. |
| @@ -201,10 +212,16 @@ | ||
| 201 | 212 | collect_argument(&extra, "vacuum",0); |
| 202 | 213 | collect_argument(&extra, "deanalyze",0); |
| 203 | 214 | collect_argument(&extra, "analyze",0); |
| 204 | 215 | collect_argument(&extra, "wal",0); |
| 205 | 216 | collect_argument(&extra, "stats",0); |
| 217 | + }else if( strncmp(zCmd, "setting", n)==0 ){ | |
| 218 | + zCmd = "setting -R"; | |
| 219 | + collect_argv(&extra, 3); | |
| 220 | + }else if( strncmp(zCmd, "unset", n)==0 ){ | |
| 221 | + zCmd = "unset -R"; | |
| 222 | + collect_argv(&extra, 3); | |
| 206 | 223 | }else if( strncmp(zCmd, "sync", n)==0 ){ |
| 207 | 224 | zCmd = "sync -autourl -R"; |
| 208 | 225 | collect_argument(&extra, "verbose","v"); |
| 209 | 226 | }else if( strncmp(zCmd, "test-integrity", n)==0 ){ |
| 210 | 227 | collect_argument(&extra, "parse", 0); |
| 211 | 228 |
| --- src/allrepo.c | |
| +++ src/allrepo.c | |
| @@ -65,10 +65,16 @@ | |
| 65 | }else{ |
| 66 | blob_appendf(pExtra, " --%s \"\"", zArg); |
| 67 | } |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | |
| 72 | /* |
| 73 | ** COMMAND: all |
| 74 | ** |
| @@ -118,10 +124,15 @@ | |
| 118 | ** present, are passed along verbatim. The --force and |
| 119 | ** --randomize options are not supported. |
| 120 | ** |
| 121 | ** sync Run a "sync" on all repositories. Only the --verbose |
| 122 | ** option is supported. |
| 123 | ** |
| 124 | ** Repositories are automatically added to the set of known repositories |
| 125 | ** when one of the following commands are run against the repository: |
| 126 | ** clone, info, pull, push, or sync. Even previously ignored repositories |
| 127 | ** are added back to the list of repositories by these commands. |
| @@ -201,10 +212,16 @@ | |
| 201 | collect_argument(&extra, "vacuum",0); |
| 202 | collect_argument(&extra, "deanalyze",0); |
| 203 | collect_argument(&extra, "analyze",0); |
| 204 | collect_argument(&extra, "wal",0); |
| 205 | collect_argument(&extra, "stats",0); |
| 206 | }else if( strncmp(zCmd, "sync", n)==0 ){ |
| 207 | zCmd = "sync -autourl -R"; |
| 208 | collect_argument(&extra, "verbose","v"); |
| 209 | }else if( strncmp(zCmd, "test-integrity", n)==0 ){ |
| 210 | collect_argument(&extra, "parse", 0); |
| 211 |
| --- src/allrepo.c | |
| +++ src/allrepo.c | |
| @@ -65,10 +65,16 @@ | |
| 65 | }else{ |
| 66 | blob_appendf(pExtra, " --%s \"\"", zArg); |
| 67 | } |
| 68 | } |
| 69 | } |
| 70 | static void collect_argv(Blob *pExtra, int iStart){ |
| 71 | int i; |
| 72 | for(i=iStart; i<g.argc; i++){ |
| 73 | blob_appendf(pExtra, " %s", g.argv[i]); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | |
| 78 | /* |
| 79 | ** COMMAND: all |
| 80 | ** |
| @@ -118,10 +124,15 @@ | |
| 124 | ** present, are passed along verbatim. The --force and |
| 125 | ** --randomize options are not supported. |
| 126 | ** |
| 127 | ** sync Run a "sync" on all repositories. Only the --verbose |
| 128 | ** option is supported. |
| 129 | ** |
| 130 | ** setting Run the "setting", "set", or "unset" commands on all |
| 131 | ** set repositories. These command are particularly useful in |
| 132 | ** unset conjunection with the "max-loadavg" setting which cannot |
| 133 | ** otherwise be set globally. |
| 134 | ** |
| 135 | ** Repositories are automatically added to the set of known repositories |
| 136 | ** when one of the following commands are run against the repository: |
| 137 | ** clone, info, pull, push, or sync. Even previously ignored repositories |
| 138 | ** are added back to the list of repositories by these commands. |
| @@ -201,10 +212,16 @@ | |
| 212 | collect_argument(&extra, "vacuum",0); |
| 213 | collect_argument(&extra, "deanalyze",0); |
| 214 | collect_argument(&extra, "analyze",0); |
| 215 | collect_argument(&extra, "wal",0); |
| 216 | collect_argument(&extra, "stats",0); |
| 217 | }else if( strncmp(zCmd, "setting", n)==0 ){ |
| 218 | zCmd = "setting -R"; |
| 219 | collect_argv(&extra, 3); |
| 220 | }else if( strncmp(zCmd, "unset", n)==0 ){ |
| 221 | zCmd = "unset -R"; |
| 222 | collect_argv(&extra, 3); |
| 223 | }else if( strncmp(zCmd, "sync", n)==0 ){ |
| 224 | zCmd = "sync -autourl -R"; |
| 225 | collect_argument(&extra, "verbose","v"); |
| 226 | }else if( strncmp(zCmd, "test-integrity", n)==0 ){ |
| 227 | collect_argument(&extra, "parse", 0); |
| 228 |
M
src/db.c
+8
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2147,10 +2147,11 @@ | ||
| 2147 | 2147 | { "ignore-glob", 0, 40, 1, 0, "" }, |
| 2148 | 2148 | { "keep-glob", 0, 40, 1, 0, "" }, |
| 2149 | 2149 | { "localauth", 0, 0, 0, 0, "off" }, |
| 2150 | 2150 | { "main-branch", 0, 40, 0, 0, "trunk" }, |
| 2151 | 2151 | { "manifest", 0, 0, 1, 0, "off" }, |
| 2152 | + { "max-loadavg", 0, 25, 0, 0, "0.0" }, | |
| 2152 | 2153 | { "max-upload", 0, 25, 0, 0, "250000" }, |
| 2153 | 2154 | { "mtime-changes", 0, 0, 0, 0, "on" }, |
| 2154 | 2155 | { "pgp-command", 0, 40, 0, 0, "gpg --clearsign -o " }, |
| 2155 | 2156 | { "proxy", 0, 32, 0, 0, "off" }, |
| 2156 | 2157 | { "relative-paths", 0, 0, 0, 0, "on" }, |
| @@ -2296,10 +2297,17 @@ | ||
| 2296 | 2297 | ** main-branch The primary branch for the project. Default: trunk |
| 2297 | 2298 | ** |
| 2298 | 2299 | ** manifest If enabled, automatically create files "manifest" and |
| 2299 | 2300 | ** (versionable) "manifest.uuid" in every checkout. The SQLite and |
| 2300 | 2301 | ** Fossil repositories both require this. Default: off. |
| 2302 | +** | |
| 2303 | +** max-loadavg Some CPU-intensive web pages (ex: /zip, /tarball, /blame) | |
| 2304 | +** are disallowed if the system load average goes above this | |
| 2305 | +** value. "0.0" means no limit. This only works on unix. | |
| 2306 | +** Only local settings of this value make a difference since | |
| 2307 | +** when running as a web-server, Fossil does not open the | |
| 2308 | +** global configuration database. | |
| 2301 | 2309 | ** |
| 2302 | 2310 | ** max-upload A limit on the size of uplink HTTP requests. The |
| 2303 | 2311 | ** default is 250000 bytes. |
| 2304 | 2312 | ** |
| 2305 | 2313 | ** mtime-changes Use file modification times (mtimes) to detect when |
| 2306 | 2314 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2147,10 +2147,11 @@ | |
| 2147 | { "ignore-glob", 0, 40, 1, 0, "" }, |
| 2148 | { "keep-glob", 0, 40, 1, 0, "" }, |
| 2149 | { "localauth", 0, 0, 0, 0, "off" }, |
| 2150 | { "main-branch", 0, 40, 0, 0, "trunk" }, |
| 2151 | { "manifest", 0, 0, 1, 0, "off" }, |
| 2152 | { "max-upload", 0, 25, 0, 0, "250000" }, |
| 2153 | { "mtime-changes", 0, 0, 0, 0, "on" }, |
| 2154 | { "pgp-command", 0, 40, 0, 0, "gpg --clearsign -o " }, |
| 2155 | { "proxy", 0, 32, 0, 0, "off" }, |
| 2156 | { "relative-paths", 0, 0, 0, 0, "on" }, |
| @@ -2296,10 +2297,17 @@ | |
| 2296 | ** main-branch The primary branch for the project. Default: trunk |
| 2297 | ** |
| 2298 | ** manifest If enabled, automatically create files "manifest" and |
| 2299 | ** (versionable) "manifest.uuid" in every checkout. The SQLite and |
| 2300 | ** Fossil repositories both require this. Default: off. |
| 2301 | ** |
| 2302 | ** max-upload A limit on the size of uplink HTTP requests. The |
| 2303 | ** default is 250000 bytes. |
| 2304 | ** |
| 2305 | ** mtime-changes Use file modification times (mtimes) to detect when |
| 2306 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2147,10 +2147,11 @@ | |
| 2147 | { "ignore-glob", 0, 40, 1, 0, "" }, |
| 2148 | { "keep-glob", 0, 40, 1, 0, "" }, |
| 2149 | { "localauth", 0, 0, 0, 0, "off" }, |
| 2150 | { "main-branch", 0, 40, 0, 0, "trunk" }, |
| 2151 | { "manifest", 0, 0, 1, 0, "off" }, |
| 2152 | { "max-loadavg", 0, 25, 0, 0, "0.0" }, |
| 2153 | { "max-upload", 0, 25, 0, 0, "250000" }, |
| 2154 | { "mtime-changes", 0, 0, 0, 0, "on" }, |
| 2155 | { "pgp-command", 0, 40, 0, 0, "gpg --clearsign -o " }, |
| 2156 | { "proxy", 0, 32, 0, 0, "off" }, |
| 2157 | { "relative-paths", 0, 0, 0, 0, "on" }, |
| @@ -2296,10 +2297,17 @@ | |
| 2297 | ** main-branch The primary branch for the project. Default: trunk |
| 2298 | ** |
| 2299 | ** manifest If enabled, automatically create files "manifest" and |
| 2300 | ** (versionable) "manifest.uuid" in every checkout. The SQLite and |
| 2301 | ** Fossil repositories both require this. Default: off. |
| 2302 | ** |
| 2303 | ** max-loadavg Some CPU-intensive web pages (ex: /zip, /tarball, /blame) |
| 2304 | ** are disallowed if the system load average goes above this |
| 2305 | ** value. "0.0" means no limit. This only works on unix. |
| 2306 | ** Only local settings of this value make a difference since |
| 2307 | ** when running as a web-server, Fossil does not open the |
| 2308 | ** global configuration database. |
| 2309 | ** |
| 2310 | ** max-upload A limit on the size of uplink HTTP requests. The |
| 2311 | ** default is 250000 bytes. |
| 2312 | ** |
| 2313 | ** mtime-changes Use file modification times (mtimes) to detect when |
| 2314 |