Skip to content

Commit 722de68

Browse files
committed
properly handle operationId in create_remote and restore_remote HTTP Handler, fix #1272
Signed-off-by: Slach <bloodjazman@gmail.com>
1 parent 902d319 commit 722de68

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/server/server.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ func (api *APIServer) httpCreateRemoteHandler(w http.ResponseWriter, r *http.Req
11751175
return
11761176
}
11771177

1178-
commandId, _ := status.Current.Start(fullCommand)
1178+
commandId, _ := status.Current.StartWithOperationId(fullCommand, operationId.String())
11791179
go func() {
11801180
err, _ := api.metrics.ExecuteWithMetrics("create_remote", 0, func() error {
11811181
b := backup.NewBackuper(cfg)
@@ -1485,8 +1485,8 @@ func (api *APIServer) httpUploadHandler(w http.ResponseWriter, r *http.Request)
14851485
return
14861486
}
14871487

1488+
commandId, _ := status.Current.StartWithOperationId(fullCommand, operationId.String())
14881489
go func() {
1489-
commandId, _ := status.Current.StartWithOperationId(fullCommand, operationId.String())
14901490
err, _ := api.metrics.ExecuteWithMetrics("upload", 0, func() error {
14911491
b := backup.NewBackuper(cfg)
14921492
return b.Upload(name, deleteSource, diffFrom, diffFromRemote, tablePattern, partitionsToBackup, skipProjections, schemaOnly, rbacOnly, configsOnly, namedCollectionsOnly, resume, api.cliApp.Version, commandId)
@@ -1925,7 +1925,7 @@ func (api *APIServer) httpRestoreRemoteHandler(w http.ResponseWriter, r *http.Re
19251925
return
19261926
}
19271927

1928-
commandId, _ := status.Current.Start(fullCommand)
1928+
commandId, _ := status.Current.StartWithOperationId(fullCommand, operationId.String())
19291929
go func() {
19301930
err, _ := api.metrics.ExecuteWithMetrics("restore_remote", 0, func() error {
19311931
b := backup.NewBackuper(cfg)
@@ -2030,8 +2030,8 @@ func (api *APIServer) httpDownloadHandler(w http.ResponseWriter, r *http.Request
20302030
return
20312031
}
20322032

2033+
commandId, _ := status.Current.StartWithOperationId(fullCommand, operationId.String())
20332034
go func() {
2034-
commandId, _ := status.Current.StartWithOperationId(fullCommand, operationId.String())
20352035
err, _ := api.metrics.ExecuteWithMetrics("download", 0, func() error {
20362036
b := backup.NewBackuper(cfg)
20372037
return b.Download(name, tablePattern, partitionsToBackup, schemaOnly, rbacOnly, configsOnly, namedCollectionsOnly, resume, hardlinkExistsFiles, api.cliApp.Version, commandId)

0 commit comments

Comments
 (0)