use of com.thoughtworks.go.server.service.result.DiskSpaceOperationResult in project gocd by gocd.
the class GoDiskSpaceMonitor method onTimer.
//Note: This method is called from a Spring timer task
public void onTimer() {
OperationResult result = new DiskSpaceOperationResult(serverHealthService);
try {
boolean outOfDisk = false;
for (DiskSpaceChecker checker : checkers) {
OperationResult callResult = checker.resultFor(result);
checker.check(callResult);
outOfDisk = outOfDisk || !result.canContinue();
}
lowOnDisk = outOfDisk;
} catch (Exception e) {
LOG.error("Error occured during checking filesystems low disk space", e);
}
}
use of com.thoughtworks.go.server.service.result.DiskSpaceOperationResult in project gocd by gocd.
the class ArtifactsDiskCleanerTest method shouldUseA_NonServerHealthAware_result.
@Test
public void shouldUseA_NonServerHealthAware_result() {
serverHealthService = mock(ServerHealthService.class);
OperationResult operationResult = artifactsDiskCleaner.resultFor(new DiskSpaceOperationResult(serverHealthService));
assertThat(operationResult, is(instanceOf(ServerHealthStateOperationResult.class)));
}
Aggregations