List of commits:
Subject Hash Author Date (UTC)
Make cron tasks more resilient in case the machine is stopped afbe8607b4608862787bf696f71027beb345701f Catalin(ux) M. BOIE 2020-08-19 06:08:34
Cosmetic 21956573027d83eb45913b6bf30eeb57e602aea4 Catalin(ux) M. BOIE 2020-08-19 06:07:45
Added time of upload for artifacts fd33fe0aeef09f66d74f3ec1554312a2fa5e2642 Catalin(ux) M. BOIE 2020-08-19 06:06:54
css fixes for table scroll 77e486f3c9e3c9356985d3c21bc713d8a8d0e223 Catalin(ux) M. BOIE 2020-08-19 06:02:09
Added git repo size 9828b1fe96e2217ead8863f7a7c0ee3599d16633 Catalin(ux) M. BOIE 2020-08-19 06:01:27
Change artifacts path to be able to compute correct sizes efff16c88415dfca0a4b52981b44620e52778c03 Catalin(ux) M. BOIE 2020-08-19 05:56:17
Some state was not under transaction fd51b92442fb83fc6941f94b22236f5014f0062c Catalin(ux) M. BOIE 2020-08-19 03:24:28
Added artifacts size to repos and users tables 2a8469e3416e63e9bb21ba0e412583fc69fea115 Catalin(ux) M. BOIE 2020-08-19 03:23:58
No need to invalidate last part ts because we already check 75cf0ae1721d9473bb8df780cc61f5c6247a7a6c Catalin(ux) M. BOIE 2020-08-19 03:20:19
Fixed some spaces in profiling 929b95c5d842ffe306031f2ba99d23e435855155 Catalin(ux) M. BOIE 2020-08-18 07:11:30
Added a link to tutorials in the welcome mail 2ef5795e53a26fdc1f9a2adda7bbf7a4f4ccb81f Catalin(ux) M. BOIE 2020-08-17 07:08:15
Change the mail goal bffa2a1f9a4b185916b700b3e8455bbf6f7a82bf Catalin(ux) M. BOIE 2020-08-17 06:59:35
One of the tests was not ran bb295b59daee2158c1a9c435a267d4d2377d36e9 Catalin(ux) M. BOIE 2020-08-17 06:47:52
Doc improvement 039b77222a8fb6e38be0b9a35329c13f86c890af Catalin(ux) M. BOIE 2020-08-17 06:47:27
Fixed form generation test b1ca5d96c15271fbe8a595a22227d15f917779dc Catalin(ux) M. BOIE 2020-08-17 06:46:56
Do not allow adding bugs if not logged in 32db254689f7419fcea479985bbeff5cc579f7e7 Catalin(ux) M. BOIE 2020-08-17 06:45:46
markdown format improvements bc1cc389bc851af6d0fb186bcfaf47525e235b6b Catalin(ux) M. BOIE 2020-08-17 06:45:01
Set the user's last IP also if she never logged in 556ff3e7df07863f977caac1cb25906f8c307583 Catalin(ux) M. BOIE 2020-08-17 06:44:03
Cosmetic d2a744bd020154afa13961f9d3d3da4c51853ff4 Catalin(ux) M. BOIE 2020-08-17 06:42:23
Improved nginx ssl configuration (mostly stapling) a029f78cc3f66605dd95dfcc2abc9976ee1f7076 Catalin(ux) M. BOIE 2020-08-06 05:05:49
Commit afbe8607b4608862787bf696f71027beb345701f - Make cron tasks more resilient in case the machine is stopped
Author: Catalin(ux) M. BOIE
Author date (UTC): 2020-08-19 06:08
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2020-08-19 06:08
Parent(s): 21956573027d83eb45913b6bf30eeb57e602aea4
Signing key:
Tree: 8d074cc07531cd6b4ae3db74b1bec51d5852c68d
File Lines added Lines deleted
scripts/cron.php 25 22
File scripts/cron.php changed (mode: 100644) (index 1867c3e..0a5a87e)
... ... if (gmdate('i') == '01') {
183 183 rg_log_enter('Clean old sess entries...'); rg_log_enter('Clean old sess entries...');
184 184 $sql = 'DELETE FROM sess WHERE expire < ' . $now; $sql = 'DELETE FROM sess WHERE expire < ' . $now;
185 185 $res = rg_sql_query($db, $sql); $res = rg_sql_query($db, $sql);
186 if ($res !== FALSE)
186 if ($res === FALSE)
187 rg_internal_error('Cannot delete expired sessions'
188 . ' (' . rg_sql_error() . ')!');
189 else
187 190 rg_sql_free_result($res); rg_sql_free_result($res);
188 191 rg_log_exit(); rg_log_exit();
189 192 } }
190 193
191 if (gmdate('Hi') == '0605') {
194 $r = rg_state_get($db, 'cron_last_clean_tokens_ip');
195 while (($r < $today_00) && (rg_load() < 50)) {
192 196 rg_log_enter('Clean old login_tokens_ip entries...'); rg_log_enter('Clean old login_tokens_ip entries...');
193 197 $sql = 'DELETE FROM login_tokens_ip WHERE expire < ' . $now; $sql = 'DELETE FROM login_tokens_ip WHERE expire < ' . $now;
194 198 $res = rg_sql_query($db, $sql); $res = rg_sql_query($db, $sql);
195 if ($res !== FALSE)
199 if ($res === FALSE) {
200 rg_internal_error('Cannot delete login_tokens_ip'
201 . ' (' . rg_sql_error() . ')!');
202 } else {
196 203 rg_sql_free_result($res); rg_sql_free_result($res);
204 rg_state_set($db, 'cron_last_clean_tokens_ip', time());
205 }
197 206 rg_log_exit(); rg_log_exit();
207 break;
198 208 } }
199 209
200 while (gmdate('Hi') == '0610') {
201 if (rg_load() > 100)
202 break;
203
204 rg_log_enter('Clean old empty slave tables...');
205 $r = rg_state_get($db, 'slave_clean_last_run');
206 if ($r === FALSE)
207 break;
208 $when = gmmktime(0, 0, 0, gmdate('m'), 1, gmdate('Y'));
209 if ($r >= $when)
210 break;
211
210 $r = rg_state_get($db, 'part_clean_last_run');
211 $when = gmmktime(0, 0, 0, gmdate('m'), 1, gmdate('Y'));
212 while (($r < $today_00) && (rg_load() < 50)) {
213 rg_log_enter('Clean old part tables...');
214 $ok = TRUE;
212 215 foreach ($rg_sql_struct_slaves as $table => $ti) { foreach ($rg_sql_struct_slaves as $table => $ti) {
213 rg_log('Slave: ' . $table);
214
215 // value is in 'months'
216 $r = rg_state_get($db, 'slave_clean_table_' . $table);
217 if ($r === FALSE)
216 // value is in 'months' = how many months we do want to keep the table
217 $r = rg_state_get($db, 'part_clean_table_' . $table);
218 if ($r === FALSE) {
219 $ok = FALSE;
218 220 break; break;
219 if ($r === '')
221 }
222 if ($r === '') // no expiration set => forever
220 223 continue; continue;
221 224 if ($r == 0) // no expiration if ($r == 0) // no expiration
222 225 continue; continue;
223 226
224 227 $ts = gmmktime(0, 0, 0, gmdate('m') - $r, 1, gmdate('Y')); $ts = gmmktime(0, 0, 0, gmdate('m') - $r, 1, gmdate('Y'));
225 228 $limit = gmdate('Y_m', $ts); $limit = gmdate('Y_m', $ts);
226 rg_log('limit=' . $limit);
229 rg_log('DEBUG: limit=' . $limit);
227 230
228 231 $sql = 'SELECT relname FROM pg_class' $sql = 'SELECT relname FROM pg_class'
229 232 . ' WHERE relname LIKE \'' . $table . '_%\'' . ' WHERE relname LIKE \'' . $table . '_%\''
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/catalinux/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/catalinux/rocketgit

Clone this repository using git:
git clone git://git.rocketgit.com/user/catalinux/rocketgit

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main