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"
|
||||
"net/http"
|
||||
"vctp/internal/report"
|
||||
"vctp/server/models"
|
||||
@@ -16,7 +15,8 @@ import (
|
||||
// @Failure 500 {object} models.SnapshotMigrationResponse "Server error"
|
||||
// @Router /api/snapshots/migrate [post]
|
||||
func (h *Handler) SnapshotMigrate(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := context.Background()
|
||||
ctx, cancel := withRequestTimeout(r, reportRequestTimeout)
|
||||
defer cancel()
|
||||
stats, err := report.MigrateSnapshotRegistry(ctx, h.Database)
|
||||
if err != nil {
|
||||
writeJSON(w, http.StatusInternalServerError, models.SnapshotMigrationResponse{
|
||||
|
||||
Reference in New Issue
Block a user