Search in sources :

Example 1 with DiskSpaceChecker

use of com.thoughtworks.go.server.service.DiskSpaceChecker 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);
    }
}
Also used : DiskSpaceOperationResult(com.thoughtworks.go.server.service.result.DiskSpaceOperationResult) OperationResult(com.thoughtworks.go.server.service.result.OperationResult) DiskSpaceOperationResult(com.thoughtworks.go.server.service.result.DiskSpaceOperationResult) DiskSpaceChecker(com.thoughtworks.go.server.service.DiskSpaceChecker) SystemDiskSpaceChecker(com.thoughtworks.go.server.service.SystemDiskSpaceChecker)

Aggregations

DiskSpaceChecker (com.thoughtworks.go.server.service.DiskSpaceChecker)1 SystemDiskSpaceChecker (com.thoughtworks.go.server.service.SystemDiskSpaceChecker)1 DiskSpaceOperationResult (com.thoughtworks.go.server.service.result.DiskSpaceOperationResult)1 OperationResult (com.thoughtworks.go.server.service.result.OperationResult)1