xaizek / rocketgit (License: AGPLv3+) (since 2018-12-09)
Light and fast Git hosting solution suitable to serve both as a hub or as a personal code storage with its tickets, pull requests, API and much more.
Commit dad6cf20f9f4bdbfe2026809a404e852e7cd8e53

Give up the cache if we cannot connect in 150ms
Author: Catalin(ux) M. BOIE
Author date (UTC): 2020-08-23 15:00
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2020-08-23 15:00
Parent(s): a0de6d683b59934168ef8415c9ec716aef68b195
Signing key:
Tree: 04eae8a615ee3ee32f118af7bb015f1e863c26a7
File Lines added Lines deleted
inc/cache.inc.php 8 1
File inc/cache.inc.php changed (mode: 100644) (index 14af748..c2b31cb)
... ... $rg_cache_timeout = 500;
16 16
17 17 $rg_cache_count = 0; $rg_cache_count = 0;
18 18 $rg_cache_tries = 3; $rg_cache_tries = 3;
19 $rg_cache_recheck = 0;
19 20
20 21 if (!isset($rg_cache_socket)) if (!isset($rg_cache_socket))
21 22 $rg_cache_socket = "/var/lib/rocketgit/sockets/cache.sock"; $rg_cache_socket = "/var/lib/rocketgit/sockets/cache.sock";
 
... ... function rg_cache_send($cmd, $para, $flags)
368 369 global $rg_cache_tries; global $rg_cache_tries;
369 370 global $rg_cache_count; global $rg_cache_count;
370 371 global $rg_cache_debug; global $rg_cache_debug;
372 global $rg_cache_recheck;
371 373
372 374 if ($rg_cache_enable === FALSE) if ($rg_cache_enable === FALSE)
373 375 return FALSE; return FALSE;
374 376
377 if ($rg_cache_recheck > time())
378 return FALSE;
379
375 380 $rg_cache_count++; $rg_cache_count++;
376 381
377 382 $f = ''; $f = '';
 
... ... function rg_cache_send($cmd, $para, $flags)
383 388 rg_log('Sending [' . $xcmd . ']...'); rg_log('Sending [' . $xcmd . ']...');
384 389 $ret = rg_socket($rg_cache_socket, $xcmd . "\n", $ret = rg_socket($rg_cache_socket, $xcmd . "\n",
385 390 $rg_cache_timeout, $rg_cache_tries, $flags); $rg_cache_timeout, $rg_cache_tries, $flags);
386 if ($ret === FALSE)
391 if ($ret === FALSE) {
392 $rg_cache_recheck = time() + 5;
387 393 return FALSE; return FALSE;
394 }
388 395 if ($rg_cache_debug) if ($rg_cache_debug)
389 396 rg_log('Received [' . $ret . ']'); rg_log('Received [' . $ret . ']');
390 397
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://code.reversed.top/user/xaizek/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/rocketgit

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