fix: acp exit not wait for event handler

This commit is contained in:
Samuel N Cui
2023-09-23 00:07:43 +08:00
parent f59f0b81a6
commit d33b0f624b
3 changed files with 6 additions and 3 deletions

View File

@@ -325,6 +325,9 @@ func (a *jobRestoreExecutor) restoreTape(ctx context.Context, device string) (re
}
defer func() {
a.stateLock.Lock()
defer a.stateLock.Unlock()
restoreTape.Status = entity.CopyStatus_SUBMITED
for _, file := range restoreTape.Files {
if file.Status == entity.CopyStatus_STAGED {

2
go.mod
View File

@@ -19,7 +19,7 @@ require (
github.com/modern-go/reflect2 v1.0.2
github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5
github.com/samber/lo v1.38.1
github.com/samuelncui/acp v0.0.0-20230922125743-18086b0be766
github.com/samuelncui/acp v0.0.0-20230922160619-0d364575f621
github.com/sirupsen/logrus v1.9.0
google.golang.org/grpc v1.53.0
google.golang.org/protobuf v1.30.0

4
go.sum
View File

@@ -363,8 +363,8 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb
github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
github.com/samuelncui/acp v0.0.0-20230922125743-18086b0be766 h1:oCViy9iD4DlfXIFuKON2VMsWN9dwuQ9w1CKvu1EVQWg=
github.com/samuelncui/acp v0.0.0-20230922125743-18086b0be766/go.mod h1:cy5nMv6EZMvC4K3u1vLdLWFGHVWeRRoOUNw0kk+Wtvo=
github.com/samuelncui/acp v0.0.0-20230922160619-0d364575f621 h1:Yycm0AjfHutB5tcY2oMqI7lJ+W7PGVVBON5J5TyRuvc=
github.com/samuelncui/acp v0.0.0-20230922160619-0d364575f621/go.mod h1:cy5nMv6EZMvC4K3u1vLdLWFGHVWeRRoOUNw0kk+Wtvo=
github.com/schollz/progressbar/v3 v3.12.2 h1:yLqqqpQNMxGxHY8uEshRihaHWwa0rf0yb7/Zrpgq2C0=
github.com/schollz/progressbar/v3 v3.12.2/go.mod h1:HFJYIYQQJX32UJdyoigUl19xoV6aMwZt6iX/C30RWfg=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=