diff options
Diffstat (limited to 'update.php')
-rwxr-xr-x | update.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/update.php b/update.php index 881db3621..8b325d7bb 100755 --- a/update.php +++ b/update.php @@ -14,6 +14,19 @@ require_once "db.php"; require_once "db-prefs.php"; + function make_stampfile($filename) { + $fp = fopen(LOCK_DIRECTORY . "/$filename", "w"); + + if (flock($fp, LOCK_EX | LOCK_NB)) { + fwrite($fp, time() . "\n"); + flock($fp, LOCK_UN); + fclose($fp); + return true; + } else { + return false; + } + } + function cleanup_tags($days = 14, $limit = 1000) { $days = (int) $days; |