--- deliantra/server/ext/schmorplog.ext 2012/02/04 00:14:41 1.31 +++ deliantra/server/ext/schmorplog.ext 2012/02/04 00:41:42 1.32 @@ -6,7 +6,7 @@ use Coro::AIO; CONF EXPORT_RECENTLOG = undef -CONF EXPORT_RECENTLOG_INTERVAL = 0.5 +CONF EXPORT_RECENTLOG_INTERVAL = 300 ############################################################################# # stuffs @@ -263,6 +263,8 @@ $Coro::current->nice (1); $Coro::current->{desc} = "recentlog updater"; + Coro::AnyEvent::sleep 5; # grace time to allow file-saves + my $lock = cf::lock_acquire "export_recentlog"; while (%need_update) { @@ -273,6 +275,8 @@ } } + undef $update_w; + cf::get_slot 0.1, 0, "recentlog serialise"; my $NOW = $cf::NOW; @@ -284,7 +288,7 @@ sort { ($b->[4] || $NOW) <=> ($a->[4] || $NOW) } values %RECENT ], - }; + } or warn "$EXPORT_RECENTLOG: $!"; cf::trace "recentlog updated (", EV::now - $t0, "s).\n"; }; @@ -314,12 +318,12 @@ } cf::player->attach ( - on_login => sub { undef $need_update{$_[0]->ob->name}; _update }, - on_logout => sub { undef $need_update{$_[0]->ob->name}; _update }, - on_birth => sub { undef $need_update{$_[0]->ob->name}; _update }, - on_death => sub { undef $need_update{$_[0]->ob->name}; _update }, - on_load => sub { undef $need_update{$_[0]->ob->name}; _update }, - on_save => sub { undef $need_update{$_[0]->ob->name}; _update }, + on_login => sub { undef $need_update{$_[0]->ob->name}; update }, + on_logout => sub { undef $need_update{$_[0]->ob->name}; update }, + on_birth => sub { undef $need_update{$_[0]->ob->name}; update }, + on_death => sub { undef $need_update{$_[0]->ob->name}; update }, +# on_load => sub { undef $need_update{$_[0]->ob->name}; update }, +# on_save => sub { undef $need_update{$_[0]->ob->name}; update }, ); cf::post_init {