mirror of
https://github.com/garethgeorge/backrest.git
synced 2026-08-29 20:36:40 +00:00
fix: stat operation interval for long running repos
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user