added throwing exception

This commit is contained in:
Барсуков Александр 2022-05-19 16:02:57 +03:00
parent 5ffb3af991
commit 32a4dd5157
1 changed files with 4 additions and 2 deletions

View File

@ -90,8 +90,10 @@ function get_version_file_lifetime()
{ {
global $GAME_ROOT; global $GAME_ROOT;
exec("git log --follow --format=%ad --date=format:'%Y-%m-%d %H:%M:%S' " . $GAME_ROOT . "/VERSION" , $creating_timestamp); exec("git log --follow --format=%ad --date=format:'%Y-%m-%d %H:%M:%S' " . $GAME_ROOT . "/VERSION" , $out, $ret);
$minutes = (time() - strtotime($creating_timestamp[0])) / 60; if($ret != 0)
throw new Exception("git error");
$minutes = (time() - strtotime($out[0])) / 60;
return ceil($minutes); return ceil($minutes);
} }