Changeset 40878
- Timestamp:
- Aug 27, 2019, 12:07:38 PM (7 years ago)
- File:
-
- 1 edited
-
trunk/ippMonitor/czartool/czartool/CzarDb.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippMonitor/czartool/czartool/CzarDb.pm
r40854 r40878 40 40 use czartool::StageMetrics; 41 41 42 42 43 ########################################################################### 43 44 # … … 54 55 55 56 return $self; 57 } 58 59 ########################################################################### 60 # 61 # Gets last czarpoll iteration time 62 # 63 ########################################################################### 64 sub getPollDate { 65 my ($self,$polldate) = @_; 66 67 my $query = $self->{_db}->prepare(<<SQL); 68 SELECT timestamp FROM chip ORDER BY timestamp DESC LIMIT 1 69 SQL 70 71 $query->execute; 72 73 $polldate = $query->fetchrow_array(); 74 75 return $polldate; 56 76 } 57 77 … … 281 301 SQL 282 302 283 $query->execute; 303 #execute the query, but check for deadlocks 304 my $db_res=0; 305 while($db_res==0) 306 { 307 $db_res=1; 308 my $result = eval{$query->execute;}; 309 unless($result) { 310 if(/DBD::mysql::st execute failed: Deadlock found when trying to get lock; try restarting transaction/){ 311 $db_res=0; 312 sleep 3; 313 } 314 } 315 } 316 284 317 } 285 318 }
Note:
See TracChangeset
for help on using the changeset viewer.
