From 66bad6b86751844d35ce5ae98c6fab378f1d60ba Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 28 Jun 2026 06:25:33 +0000 Subject: [PATCH] feat(farm-aggregator): switch to Render free cron jobs (3 services) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces the persistent web service with 3 separate Render Cron Job services — pulse (hourly), daily digest (06:00), weekly summary (Mon 06:00). Each job runs and exits, no $7/mo web service needed. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01KBD2dN2KEjzz3UQFa9hEpu --- farm-aggregator/render.yaml | 39 ++++++++++++++++++--------- farm-aggregator/scripts/run-daily.js | 2 ++ farm-aggregator/scripts/run-pulse.js | 2 ++ farm-aggregator/scripts/run-weekly.js | 2 ++ 4 files changed, 32 insertions(+), 13 deletions(-) create mode 100644 farm-aggregator/scripts/run-daily.js create mode 100644 farm-aggregator/scripts/run-pulse.js create mode 100644 farm-aggregator/scripts/run-weekly.js diff --git a/farm-aggregator/render.yaml b/farm-aggregator/render.yaml index 7338144..1711266 100644 --- a/farm-aggregator/render.yaml +++ b/farm-aggregator/render.yaml @@ -1,14 +1,13 @@ services: - - type: web - name: farm-aggregator + - type: cron + name: farm-pulse runtime: node rootDir: farm-aggregator buildCommand: npm install - startCommand: node index.js - plan: starter - envVars: - - key: NODE_ENV - value: production + startCommand: node scripts/run-pulse.js + schedule: "0 * * * *" + plan: free + envVars: &env - key: ANTHROPIC_API_KEY sync: false - key: AGREFINE_API_URL @@ -37,9 +36,23 @@ services: sync: false - key: TOMTOM_API_KEY sync: false - - key: PULSE_SCHEDULE - value: "0 * * * *" - - key: DAILY_SCHEDULE - value: "0 6 * * *" - - key: WEEKLY_SCHEDULE - value: "0 6 * * 1" + + - type: cron + name: farm-daily-digest + runtime: node + rootDir: farm-aggregator + buildCommand: npm install + startCommand: node scripts/run-daily.js + schedule: "0 6 * * *" + plan: free + envVars: *env + + - type: cron + name: farm-weekly-summary + runtime: node + rootDir: farm-aggregator + buildCommand: npm install + startCommand: node scripts/run-weekly.js + schedule: "0 6 * * 1" + plan: free + envVars: *env diff --git a/farm-aggregator/scripts/run-daily.js b/farm-aggregator/scripts/run-daily.js new file mode 100644 index 0000000..7d6f060 --- /dev/null +++ b/farm-aggregator/scripts/run-daily.js @@ -0,0 +1,2 @@ +import { runDaily } from '../jobs/digest.js'; +runDaily().then(() => process.exit(0)).catch((e) => { console.error(e); process.exit(1); }); diff --git a/farm-aggregator/scripts/run-pulse.js b/farm-aggregator/scripts/run-pulse.js new file mode 100644 index 0000000..fba194b --- /dev/null +++ b/farm-aggregator/scripts/run-pulse.js @@ -0,0 +1,2 @@ +import { runPulse } from '../jobs/pulse.js'; +runPulse().then(() => process.exit(0)).catch((e) => { console.error(e); process.exit(1); }); diff --git a/farm-aggregator/scripts/run-weekly.js b/farm-aggregator/scripts/run-weekly.js new file mode 100644 index 0000000..405d548 --- /dev/null +++ b/farm-aggregator/scripts/run-weekly.js @@ -0,0 +1,2 @@ +import { runWeekly } from '../jobs/digest.js'; +runWeekly().then(() => process.exit(0)).catch((e) => { console.error(e); process.exit(1); });