+ foreach my $server (@servers)
+ {
+ if (my $testids = $server->{statuscake})
+ {
+ $server->{status} = "up";
+
+ for my $testid (@$testids)
+ {
+ my $testresult = $cache->{$testid} || "down";
+
+ $server->{status} = "down" if $testresult eq "down";
+ }
+ }
+ else
+ {
+ $server->{status} = "down";
+ }
+ }
+
+ YAML::DumpFile("statuscake.yml", $cache);