Skip to content

Commit

Permalink
feat: increase execution time for cron function API for handling stal…
Browse files Browse the repository at this point in the history
…e ens entries.
  • Loading branch information
brunomenezes committed Jan 7, 2025
1 parent 0ea2e13 commit f2f7ea7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/staking/src/pages/api/cron/ens-update-stale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ const cronSecret = process.env.CRON_SECRET;
const isAuthorized = (req: NextApiRequest) =>
req.headers.authorization === `Bearer ${cronSecret}`;

/**
* This function will be allowed to run for a maximum of 30 seconds.
*/
export const config = {
maxDuration: 30,
};

const handler = async (req: NextApiRequest, res: NextApiResponse) => {
if (!isAuthorized(req))
return handleResponse({ ok: false, error: 'unauthorized' }, res);
Expand Down

0 comments on commit f2f7ea7

Please sign in to comment.