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"
|
||||
"net/http"
|
||||
"vctp/db/queries"
|
||||
@@ -28,7 +27,8 @@ func (h *Handler) VmUpdateDetails(w http.ResponseWriter, r *http.Request) {
|
||||
var vmUuid string
|
||||
var dbUuid string
|
||||
|
||||
ctx := context.Background()
|
||||
ctx, cancel := withRequestTimeout(r, longRunningRequestTimeout)
|
||||
defer cancel()
|
||||
|
||||
// reload settings in case vcenter list has changed
|
||||
h.Settings.ReadYMLSettings()
|
||||
@@ -101,7 +101,7 @@ func (h *Handler) VmUpdateDetails(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
h.Logger.Debug("database params", "params", params)
|
||||
err := h.Database.Queries().InventoryUpdate(context.Background(), params)
|
||||
err := h.Database.Queries().InventoryUpdate(ctx, params)
|
||||
|
||||
if err != nil {
|
||||
h.Logger.Error("Error received updating inventory for VM", "name", vmObj.Name, "error", err)
|
||||
|
||||
Reference in New Issue
Block a user