Changeset 13251 for trunk/Nebulous-Server/bin/nebdiskd
- Timestamp:
- May 4, 2007, 1:36:46 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous-Server/bin/nebdiskd (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/bin/nebdiskd
r13023 r13251 3 3 # Copyright (C) 2007 Joshua Hoblitt 4 4 # 5 # $Id: nebdiskd,v 1. 3 2007-04-25 19:52:49jhoblitt Exp $5 # $Id: nebdiskd,v 1.4 2007-05-04 23:36:46 jhoblitt Exp $ 6 6 7 7 use strict; … … 98 98 stat_dirs($mounts); 99 99 100 my $query = $dbh->prepare_cached("INSERT INTO mount VALUES(?, ?, ?)"); 101 $dbh->do("DELETE FROM mount"); 102 print "flushed mount table\n" if $debug; 103 104 my $stats = $lxs->get; 105 foreach my $dev (keys %$stats) { 106 my $mnt = $stats->{$dev}; 107 my %mount; 108 $query->execute(@$mnt{qw( mountpoint total usage )}); 109 print "adding $mnt->{mountpoint} to db\n" if $debug; 100 eval { 101 my $query = $dbh->prepare_cached("INSERT INTO mount VALUES(?, ?, ?)"); 102 $dbh->do("DELETE FROM mount"); 103 104 print "flushed mount table\n" if $debug; 105 106 my $stats = $lxs->get; 107 foreach my $dev (keys %$stats) { 108 my $mnt = $stats->{$dev}; 109 my %mount; 110 $query->execute(@$mnt{qw( mountpoint total usage )}); 111 print "adding $mnt->{mountpoint} to db\n" if $debug; 112 } 113 114 $dbh->do("call getmountedvol()"); 115 116 $dbh->commit; 117 }; 118 if ($@) { 119 $db->rollback; 120 warn $@; 110 121 } 111 112 $dbh->commit;113 122 114 123 sleep $poll_interval; … … 155 164 ); 156 165 157 $dbh->do( $sql->set_transaction_model ); 158 $dbh->commit; 166 eval { 167 $dbh->do( $sql->set_transaction_model ); 168 $dbh->commit; 169 }; 170 if ($@) { 171 $db->rollback; 172 die $@; 173 } 159 174 160 175 return $dbh;
Note:
See TracChangeset
for help on using the changeset viewer.
