What the linter reports:
- Do not await handle.result() in onSuccess, it bills the full wait time.
- Do not await handle.result() in run, it causes GGT_TRANSACTION_TIMEOUT.
Examples
- Incorrect
- Correct
api/models/widget/actions/create.ts
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Disallow awaiting handle.result() inside run or onSuccess exports in Gadget actions.
| Recommended | Strict | Auto-fixable | Scope |
|---|---|---|---|
| warn | error | false | Gadget action files |
export const run = async () => {
const handle = await api.enqueue(api.publish, {});
// awaiting the result blocks the transaction and causes GGT_TRANSACTION_TIMEOUT
await handle.result();
};
export const run = async () => {
// enqueue the background action and move on
await api.enqueue(api.publish, {});
};
Was this page helpful?