Просмотр исходного кода

bugfix: fixed old bug for parallel calc user quotes

root 1 год назад
Родитель
Сommit
7f181ee
1 измененных файлов с 2 добавлено и 6 удалено
  1. 2 6
      scripts/eyelib/database.pm

+ 2 - 6
scripts/eyelib/database.pm

@@ -1912,10 +1912,7 @@ my $timeshift = shift || 60;
 
 Del_Variable($db,$name);
 my $clean_variables = time() + $timeshift;
-my ($sec,$min,$hour,$day,$month,$year,$zone) = localtime($clean_variables);
-$month++;
-$year += 1900;
-my $clean_str=sprintf "%04d-%02d-%02d %02d:%02d:%02d",$year,$month,$day,$hour,$min,$sec;
+my $clean_str=GetTimeStrByUnixTime($clean_variables);
 my $clean_variables_date=$db->quote($clean_str);
 do_sql($db,"INSERT INTO variables(name,value,clear_time) VALUES('".$name."','".$value."',".$clean_variables_date.");");
 }
@@ -1952,9 +1949,8 @@ clean_variables($db);
 return if (Get_Variable($db,'RECALC'));
 
 my $timeshift = get_option($db,55);
-if ($timeshift >5 ) { $timeshift=$timeshift-1; }
 
-Set_Variable($db,'RECALC',$calc_id,time()+$timeshift*60);
+Set_Variable($db,'RECALC',$calc_id,$timeshift);
 
 my $now = DateTime->now(time_zone=>'local');
 my $day_start = $db->quote($now->ymd("-")." 00:00:00");