Skip to content

Commit

Permalink
fix: stat operation interval for long running repos
Browse files Browse the repository at this point in the history
  • Loading branch information
garethgeorge committed Feb 28, 2024
1 parent 79715a9 commit f2477ab
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion internal/oplog/oplog.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/orchestrator/taskstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit f2477ab

Please sign in to comment.