Removed default history truncating

This commit is contained in:
xdrm-brackets 2017-09-26 16:20:52 +02:00
parent 9a62d404fa
commit 9b580638ba
1 changed files with 1 additions and 40 deletions

View File

@ -151,46 +151,7 @@
/* [6] Remove history entries /* [6] Remove features' entries
=========================================================*/
/* (0) We are done if @sync */
if( $sync ){
slog('Post-sync deployment -> no history truncate', 'api:deploy', 'update');
return 0;
}
/* (1) Check history entries count */
if( !isset($arr_r['saved']) || !is_array($arr_r['saved']) ){
slog('No \'saved\' found in api.response file', 'api:deploy', 'update');
return 127;
}
/* (2) Check history count */
if( !isset($arr_r['saved']['history']) || !is_numeric($arr_r['saved']['history']) ){
slog('No \'actions\'.\'history\' found in api.response file', 'api:deploy', 'update');
return 127;
}
/* (3) Fetch number of entries */
$saved = intval($arr_r['saved']['history']);
$saved = $saved < 0 ? 0 : $saved; // prevent negative
/* (4) Truncate the log file */
$truncated = syscall(SOURCE_DIR."/lib/file/truncate mfrc522 {$saved}");
/* (5) Manage error */
if( $truncated === false ){
slog('History cannot be truncated', 'api:deploy', 'update');
return 127;
}
slog('History succesfully truncated', 'api:deploy', 'update');
return 0;
/* [7] Remove features' entries
=========================================================*/ =========================================================*/
/* (0) We are done if @sync */ /* (0) We are done if @sync */
if( $sync ){ if( $sync ){