Add success log message

This commit is contained in:
Lou Knauer 2022-02-15 13:31:54 +01:00
parent 5c5a9f8453
commit 8d4498f58e

View File

@ -328,8 +328,8 @@ func (api *RestApi) stopJob(rw http.ResponseWriter, r *http.Request) {
rw.WriteHeader(http.StatusOK) rw.WriteHeader(http.StatusOK)
json.NewEncoder(rw).Encode(job) json.NewEncoder(rw).Encode(job)
// We need to start a new goroutine as this functions need to return in order to // We need to start a new goroutine as this functions needs to return
// make sure that the response is flushed to the client. // for the response to be flushed to the client.
api.OngoingArchivings.Add(1) // So that a shutdown does not interrupt this goroutine. api.OngoingArchivings.Add(1) // So that a shutdown does not interrupt this goroutine.
go func() { go func() {
defer api.OngoingArchivings.Done() defer api.OngoingArchivings.Done()
@ -347,6 +347,8 @@ func (api *RestApi) stopJob(rw http.ResponseWriter, r *http.Request) {
log.Errorf("archiving job (dbid: %d) failed: %s", job.ID, err.Error()) log.Errorf("archiving job (dbid: %d) failed: %s", job.ID, err.Error())
return return
} }
log.Printf("archiving job (dbid: %d) successful", job.ID)
}() }()
} }