Skip to content

Commit d106318

Browse files
committed
debug logs
1 parent 0d66087 commit d106318

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

dbos/admin_server.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ func newAdminServer(ctx *dbosContext, port int) *adminServer {
115115

116116
mux := http.NewServeMux()
117117

118+
ctx.logger.Debug("Registering admin server endpoint", "pattern", _HEALTHCHECK_PATTERN)
118119
mux.HandleFunc(_HEALTHCHECK_PATTERN, func(w http.ResponseWriter, r *http.Request) {
119120
w.Header().Set("Content-Type", "application/json")
120121
w.WriteHeader(http.StatusOK)
@@ -126,6 +127,7 @@ func newAdminServer(ctx *dbosContext, port int) *adminServer {
126127
}
127128
})
128129

130+
ctx.logger.Debug("Registering admin server endpoint", "pattern", _WORKFLOW_RECOVERY_PATTERN)
129131
mux.HandleFunc(_WORKFLOW_RECOVERY_PATTERN, func(w http.ResponseWriter, r *http.Request) {
130132
var executorIDs []string
131133
if err := json.NewDecoder(r.Body).Decode(&executorIDs); err != nil {
@@ -156,6 +158,7 @@ func newAdminServer(ctx *dbosContext, port int) *adminServer {
156158
}
157159
})
158160

161+
ctx.logger.Debug("Registering admin server endpoint", "pattern", _DEACTIVATE_PATTERN)
159162
mux.HandleFunc(_DEACTIVATE_PATTERN, func(w http.ResponseWriter, r *http.Request) {
160163
if as.isDeactivated.CompareAndSwap(0, 1) {
161164
ctx.logger.Info("Deactivating DBOS executor", "executor_id", ctx.executorID, "app_version", ctx.applicationVersion)
@@ -169,6 +172,7 @@ func newAdminServer(ctx *dbosContext, port int) *adminServer {
169172
}
170173
})
171174

175+
ctx.logger.Debug("Registering admin server endpoint", "pattern", _WORKFLOW_QUEUES_METADATA_PATTERN)
172176
mux.HandleFunc(_WORKFLOW_QUEUES_METADATA_PATTERN, func(w http.ResponseWriter, r *http.Request) {
173177
queueMetadataArray := ctx.queueRunner.listQueues()
174178

@@ -180,6 +184,7 @@ func newAdminServer(ctx *dbosContext, port int) *adminServer {
180184
}
181185
})
182186

187+
ctx.logger.Debug("Registering admin server endpoint", "pattern", _GARBAGE_COLLECT_PATTERN)
183188
mux.HandleFunc(_GARBAGE_COLLECT_PATTERN, func(w http.ResponseWriter, r *http.Request) {
184189
var inputs struct {
185190
CutoffEpochTimestampMs *int64 `json:"cutoff_epoch_timestamp_ms"`
@@ -202,6 +207,7 @@ func newAdminServer(ctx *dbosContext, port int) *adminServer {
202207
w.WriteHeader(http.StatusNoContent)
203208
})
204209

210+
ctx.logger.Debug("Registering admin server endpoint", "pattern", _GLOBAL_TIMEOUT_PATTERN)
205211
mux.HandleFunc(_GLOBAL_TIMEOUT_PATTERN, func(w http.ResponseWriter, r *http.Request) {
206212
var inputs struct {
207213
CutoffEpochTimestampMs *int64 `json:"cutoff_epoch_timestamp_ms"`
@@ -223,6 +229,7 @@ func newAdminServer(ctx *dbosContext, port int) *adminServer {
223229
w.WriteHeader(http.StatusNoContent)
224230
})
225231

232+
ctx.logger.Debug("Registering admin server endpoint", "pattern", _WORKFLOWS_PATTERN)
226233
mux.HandleFunc(_WORKFLOWS_PATTERN, func(w http.ResponseWriter, r *http.Request) {
227234
var req listWorkflowsRequest
228235
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
@@ -244,6 +251,7 @@ func newAdminServer(ctx *dbosContext, port int) *adminServer {
244251
}
245252
})
246253

254+
ctx.logger.Debug("Registering admin server endpoint", "pattern", _QUEUED_WORKFLOWS_PATTERN)
247255
mux.HandleFunc(_QUEUED_WORKFLOWS_PATTERN, func(w http.ResponseWriter, r *http.Request) {
248256
var req listWorkflowsRequest
249257
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
@@ -266,6 +274,7 @@ func newAdminServer(ctx *dbosContext, port int) *adminServer {
266274
})
267275

268276
// GET /workflows/{id}/steps
277+
ctx.logger.Debug("Registering admin server endpoint", "pattern", _WORKFLOW_STEPS_PATTERN)
269278
mux.HandleFunc(_WORKFLOW_STEPS_PATTERN, func(w http.ResponseWriter, r *http.Request) {
270279
workflowID := r.PathValue("id")
271280

@@ -284,6 +293,7 @@ func newAdminServer(ctx *dbosContext, port int) *adminServer {
284293
})
285294

286295
// POST /workflows/{id}/cancel
296+
ctx.logger.Debug("Registering admin server endpoint", "pattern", _WORKFLOW_CANCEL_PATTERN)
287297
mux.HandleFunc(_WORKFLOW_CANCEL_PATTERN, func(w http.ResponseWriter, r *http.Request) {
288298
workflowID := r.PathValue("id")
289299
ctx.logger.Info("Cancelling workflow", "workflow_id", workflowID)
@@ -299,6 +309,7 @@ func newAdminServer(ctx *dbosContext, port int) *adminServer {
299309
})
300310

301311
// POST /workflows/{id}/resume
312+
ctx.logger.Debug("Registering admin server endpoint", "pattern", _WORKFLOW_RESUME_PATTERN)
302313
mux.HandleFunc(_WORKFLOW_RESUME_PATTERN, func(w http.ResponseWriter, r *http.Request) {
303314
workflowID := r.PathValue("id")
304315
ctx.logger.Info("Resuming workflow", "workflow_id", workflowID)
@@ -313,6 +324,7 @@ func newAdminServer(ctx *dbosContext, port int) *adminServer {
313324
w.WriteHeader(http.StatusNoContent)
314325
})
315326

327+
ctx.logger.Debug("Registering admin server endpoint", "pattern", _WORKFLOW_RESTART_PATTERN)
316328
mux.HandleFunc(_WORKFLOW_RESTART_PATTERN, func(w http.ResponseWriter, r *http.Request) {
317329
workflowID := r.PathValue("id")
318330
ctx.logger.Info("Restarting workflow", "workflow_id", workflowID)
@@ -340,6 +352,7 @@ func newAdminServer(ctx *dbosContext, port int) *adminServer {
340352
}
341353
})
342354

355+
ctx.logger.Debug("Registering admin server endpoint", "pattern", _WORKFLOW_FORK_PATTERN)
343356
mux.HandleFunc(_WORKFLOW_FORK_PATTERN, func(w http.ResponseWriter, r *http.Request) {
344357
workflowID := r.PathValue("id")
345358
var data struct {

0 commit comments

Comments
 (0)