ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/map-random.ext
(Generate patch)

Comparing deliantra/server/ext/map-random.ext (file contents):
Revision 1.46 by root, Tue May 4 21:45:42 2010 UTC vs.
Revision 1.47 by root, Fri Feb 3 03:01:45 2012 UTC

1#! perl # mandatory 1#! perl # mandatory
2 2
3use Coro::AIO; 3use Coro::AIO;
4
5CONF META_TIMEOUT : map_random_meta_timeout = 86400 * 7;
4 6
5cf::map->register (qr{^\?random/([0-9a-f]{32})}); 7cf::map->register (qr{^\?random/([0-9a-f]{32})});
6 8
7sub init { 9sub init {
8 my ($self) = @_; 10 my ($self) = @_;
149cf::async_ext { 151cf::async_ext {
150 local $Coro::current->{desc} = "random map meta file cleaner"; 152 local $Coro::current->{desc} = "random map meta file cleaner";
151 $Coro::current->nice (1); 153 $Coro::current->nice (1);
152 154
153 while () { 155 while () {
154 my $META_TIMEOUT = $cf::CFG{map_random_meta_timeout} || 86400 * 7;
155
156 Coro::AnyEvent::idle_upto $META_TIMEOUT / 10 * 2; 156 Coro::AnyEvent::idle_upto $META_TIMEOUT / 10 * 2;
157 157
158 my ($files) = Coro::AIO::aio_readdirx $cf::RANDOMDIR, IO::AIO::READDIR_STAT_ORDER 158 my ($files) = Coro::AIO::aio_readdirx $cf::RANDOMDIR, IO::AIO::READDIR_STAT_ORDER
159 or return; 159 or return;
160 160

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines