Skip to content

Commit 8f5f2db

Browse files
committed
Add sentry message if celery is enabled, but parameters are missing
1 parent 3e47e64 commit 8f5f2db

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

  • client/src/components/Tool/submit
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
1+
import * as Sentry from "@sentry/vue";
2+
13
import { useConfigStore } from "@/stores/configurationStore";
24

35
import { submitToolJob as submitAsync } from "./submitAsync";
46
import { submitToolJob as submitLegacy } from "./submitLegacy";
57

68
export async function submitToolJob(params) {
79
const configStore = useConfigStore();
10+
const celeryEnabled = !!configStore.config?.enable_celery_tasks;
811
const hasParameters = Array.isArray(params.formConfig?.parameters);
9-
if (configStore.config?.enable_celery_tasks && hasParameters) {
12+
if (celeryEnabled && hasParameters) {
1013
return submitAsync(params);
1114
}
15+
if (celeryEnabled && !hasParameters) {
16+
Sentry.captureMessage("tool submission fell back to /api/tools: no typed parameters", {
17+
level: "info",
18+
tags: {
19+
fallback_reason: "no_parameters",
20+
tool_id: params.jobDef?.tool_id,
21+
},
22+
});
23+
}
1224
return submitLegacy(params);
1325
}

0 commit comments

Comments
 (0)