ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC.pm (file contents):
Revision 1.116 by root, Fri Aug 18 01:01:00 2006 UTC vs.
Revision 1.117 by root, Sat Aug 19 02:49:53 2006 UTC

69my %DB_SYNC; 69my %DB_SYNC;
70 70
71sub put($$$) { 71sub put($$$) {
72 my ($db, $key, $data) = @_; 72 my ($db, $key, $data) = @_;
73 73
74 my $key = $db + 0; 74 my $hkey = $db + 0;
75 Scalar::Util::weaken $db; 75 Scalar::Util::weaken $db;
76 $DB_SYNC{$key} ||= AnyEvent->timer (after => 5, cb => sub { 76 $DB_SYNC{$hkey} ||= AnyEvent->timer (after => 5, cb => sub {
77 delete $DB_SYNC{$key}; 77 delete $DB_SYNC{$hkey};
78 $db->db_sync if $db; 78 $db->db_sync if $db;
79 }); 79 });
80 80
81 $db->db_put ($key => $data) 81 $db->db_put ($key => $data)
82} 82}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines