From: Robert 'phaylon' Sedlacek Date: Fri, 27 Jul 2012 21:11:34 +0000 (+0000) Subject: don't load all results at once before writing X-Git-Tag: v0.001_001~17 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4e6909625eef11b5f77a200eaab8269603fe6ad2;p=scpubgit%2FSystem-Introspector.git don't load all results at once before writing --- diff --git a/lib/System/Introspector/State.pm b/lib/System/Introspector/State.pm index 8141d80..e2b15f1 100644 --- a/lib/System/Introspector/State.pm +++ b/lib/System/Introspector/State.pm @@ -26,15 +26,10 @@ sub gather { push @waiting, [$host, $self->fetch($host, $group)]; } $self->_log("Now waiting for results"); - my @results = map { + for my $wait (@waiting) { my ($host, @futures) = @$_; - my $done = [$host, await_all @futures]; + my @data = await_all @futures; $self->_log("Received all from group '$group' on '$host'"); - $done; - } @waiting; - $self->_log("All gathered for group '$group'"); - for my $result (@results) { - my ($host, @data) = @$result; $self->_store($host, $group, +{ map %$_, @data }); } }