From 0731a8d56e6ee64ee3fa7cfa64de23c6aaaed64e Mon Sep 17 00:00:00 2001 From: Gareth George Date: Wed, 21 Feb 2024 15:21:20 -0800 Subject: [PATCH] fix: stat operation interval for long running repos --- README.md | 2 +- internal/oplog/oplog.go | 2 +- internal/orchestrator/taskstats.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 10945ab4..9b4a85b4 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Download options * Download and run a release from the [releases page](https://github.com/garethgeorge/backrest/releases). * Build from source ([see below](#building)). - * Run with docker: `garethgeorge/backrest:latest` ([see on dockerhub](https://hub.docker.com/r/garethgeorge/backrest)) + * Run with docker: `garethgeorge/backrest:latest` ([see on dockerhub](https://hub.docker.com/r/garethgeorge/backrest)) or `garethgeorge/backrest:latest-alpine` for an image that includes rclone and common unix utilities. Backrest is accessible from a web browser. By default it binds to `0.0.0.0:9898` and can be accessed at `http://localhost:9898`. Change the port with the `BACKREST_PORT` environment variable e.g. `BACKREST_PORT=127.0.0.1 backrest` to listen only on local interfaces. On first startup backrest will prompt you to create a default username and password, this can be changed later in the settings page. diff --git a/internal/oplog/oplog.go b/internal/oplog/oplog.go index cf2a4cf1..0a74ceee 100644 --- a/internal/oplog/oplog.go +++ b/internal/oplog/oplog.go @@ -96,7 +96,7 @@ func (o *OpLog) Scan(onIncomplete func(op *v1.Operation)) error { continue } - if op.Status == v1.OperationStatus_STATUS_PENDING || op.Status == v1.OperationStatus_STATUS_SYSTEM_CANCELLED || op.Status == v1.OperationStatus_STATUS_USER_CANCELLED { + if op.Status == v1.OperationStatus_STATUS_PENDING || op.Status == v1.OperationStatus_STATUS_SYSTEM_CANCELLED || op.Status == v1.OperationStatus_STATUS_USER_CANCELLED || op.Status == v1.OperationStatus_STATUS_UNKNOWN { // remove pending or user cancelled operations. removeIds = append(removeIds, op.Id) continue diff --git a/internal/orchestrator/taskstats.go b/internal/orchestrator/taskstats.go index b40b62cf..9efec95c 100644 --- a/internal/orchestrator/taskstats.go +++ b/internal/orchestrator/taskstats.go @@ -44,7 +44,7 @@ func (t *StatsTask) Name() string { func (t *StatsTask) shouldRun() (bool, error) { var bytesSinceLastStat int64 = -1 var howFarBack int = 0 - if err := t.orch.OpLog.ForEachByRepo(t.plan.Repo, indexutil.Reversed(indexutil.CollectLastN(statOperationsThreshold)), func(op *v1.Operation) error { + if err := t.orch.OpLog.ForEachByRepo(t.plan.Repo, indexutil.Reversed(indexutil.CollectAll()), func(op *v1.Operation) error { if op.Status == v1.OperationStatus_STATUS_PENDING || op.Status == v1.OperationStatus_STATUS_INPROGRESS { return nil }