Skip to content

Commit

Permalink
set expire time on vercel-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavomm19 committed Oct 10, 2023
1 parent 688a8ea commit 09236d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/api/asset/[assetSlug].js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable consistent-return */
import { kv } from '@vercel/kv';
import bc from '../../../common/services/breathecode';
import { getExtensionName } from '../../../utils';
import { setCacheItem } from '../../../utils/requests';

const BREATHECODE_HOST = process.env.BREATHECODE_HOST || 'https://breathecode-test.herokuapp.com';

Expand Down Expand Up @@ -54,7 +54,7 @@ export default async function handler(req, res) {
asset.markdown = markdown;
asset.ipynbHtml = ipynbHtml;

await kv.set(assetSlug, asset);
await setCacheItem(assetSlug, asset);

res.status(200).json({ message: `${asset.slug} updated` });
} catch (e) {
Expand Down

0 comments on commit 09236d3

Please sign in to comment.