Refactor code to use 'any' type and improve context handling
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
@@ -28,6 +27,8 @@ func (h *Handler) VmDeleteEvent(w http.ResponseWriter, r *http.Request) {
|
||||
if h.denyLegacyAPI(w, "/api/event/vm/delete") {
|
||||
return
|
||||
}
|
||||
ctx, cancel := withRequestTimeout(r, defaultRequestTimeout)
|
||||
defer cancel()
|
||||
|
||||
var (
|
||||
deletedTimestamp int64
|
||||
@@ -71,7 +72,7 @@ func (h *Handler) VmDeleteEvent(w http.ResponseWriter, r *http.Request) {
|
||||
DatacenterName: sql.NullString{String: event.CloudEvent.Data.Datacenter.Name, Valid: event.CloudEvent.Data.Datacenter.Name != ""},
|
||||
}
|
||||
h.Logger.Debug("database params", "params", params)
|
||||
err = h.Database.Queries().InventoryMarkDeleted(context.Background(), params)
|
||||
err = h.Database.Queries().InventoryMarkDeleted(ctx, params)
|
||||
|
||||
if err != nil {
|
||||
h.Logger.Error("Error received marking VM as deleted", "error", err)
|
||||
|
||||
Reference in New Issue
Block a user