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 |
|
|