Skip to content

Commit b6fc68a

Browse files
committed
Don’t use Graphile for invocation usage reporting
1 parent 3421f5e commit b6fc68a

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

apps/webapp/app/v3/services/createTaskRunAttempt.server.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { machinePresetFromConfig } from "../machinePresets.server";
99
import { workerQueue } from "~/services/worker.server";
1010
import { MAX_TASK_RUN_ATTEMPTS } from "~/consts";
1111
import { CrashTaskRunService } from "./crashTaskRun.server";
12+
import { reportInvocationUsage } from "~/services/platform.v3.server";
1213

1314
export class CreateTaskRunAttemptService extends BaseService {
1415
public async call(
@@ -149,14 +150,8 @@ export class CreateTaskRunAttemptService extends BaseService {
149150
}
150151

151152
if (taskRunAttempt.number === 1 && taskRun.baseCostInCents > 0) {
152-
await workerQueue.enqueue("v3.reportUsage", {
153-
orgId: environment.organizationId,
154-
data: {
155-
costInCents: String(taskRun.baseCostInCents),
156-
},
157-
additionalData: {
158-
runId: taskRun.id,
159-
},
153+
await reportInvocationUsage(environment.organizationId, taskRun.baseCostInCents, {
154+
runId: taskRun.id,
160155
});
161156
}
162157

0 commit comments

Comments
 (0)