A decentralized music tracking and discovery platform built on AT Protocol 馃幍 rocksky.app
spotify atproto lastfm musicbrainz scrobbling listenbrainz
99
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 19fbd5ef3ef3791b32aa69dfce368456cd2a9f4a 35 lines 885 B view raw
1#!/usr/bin/env -S deno run --unstable-cron -A 2 3/// <reference lib="deno.ns" /> 4/// <reference lib="dom" /> 5 6import chalk from "chalk"; 7 8const args = Deno.args; 9 10if (args.length < 2) { 11 console.log( 12 chalk.greenBright("Usage: cron <interval-in-minutes> <command> [args...]") 13 ); 14 Deno.exit(0); 15} 16 17const interval = parseInt(args[0], 10); 18if (Number.isNaN(interval) || interval <= 0) { 19 console.error("Interval must be a positive integer"); 20 Deno.exit(1); 21} 22 23Deno.cron("cron", { minute: { every: interval } }, async () => { 24 const command = new Deno.Command(args[1], { 25 args: args.slice(2), 26 stdout: "inherit", 27 stderr: "inherit", 28 }); 29 const child = command.spawn(); 30 const status = await child.status; 31 if (!status.success) { 32 console.error(`Cron job failed with code ${status.code}`); 33 } 34 console.log(`Cron job executed at ${new Date().toISOString()}`); 35});