Runs every 1 days
1
2
3
4
5
6
7
import { Statement } from "https://esm.town/v/postpostscript/sqliteBuilder?v=36";
import { startOfDay } from "https://esm.sh/date-fns/startOfDay.mjs";
export default async function (interval: Interval) {
const endPoint = startOfDay(new Date());
await Statement`delete from emails where timestamp < ${endPoint.getTime()}`.execute();
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
April 27, 2024