Merge branch 'fix-cron-directory'

This commit is contained in:
Chris Wanstrath 2026-03-01 22:31:47 -08:00
commit 6e5d665846
3 changed files with 4 additions and 5 deletions

View File

@ -572,7 +572,7 @@ app.post('/new', async c => {
return c.redirect('/new?error=invalid-name') return c.redirect('/new?error=invalid-name')
} }
const cronDir = join(APPS_DIR, appName, 'current', 'cron') const cronDir = join(APPS_DIR, appName, 'cron')
const filePath = join(cronDir, `${name}.ts`) const filePath = join(cronDir, `${name}.ts`)
// Check if file already exists // Check if file already exists

View File

@ -13,8 +13,7 @@ export async function getApps(): Promise<string[]> {
for (const entry of entries) { for (const entry of entries) {
if (!entry.isDirectory()) continue if (!entry.isDirectory()) continue
// Check if it has a current symlink (valid app) if (existsSync(join(APPS_DIR, entry.name, 'package.json'))) {
if (existsSync(join(APPS_DIR, entry.name, 'current'))) {
apps.push(entry.name) apps.push(entry.name)
} }
} }
@ -35,7 +34,7 @@ export async function discoverCronJobs(): Promise<DiscoveryResult> {
for (const app of apps) { for (const app of apps) {
if (!app.isDirectory()) continue if (!app.isDirectory()) continue
const cronDir = join(APPS_DIR, app.name, 'current', 'cron') const cronDir = join(APPS_DIR, app.name, 'cron')
if (!existsSync(cronDir)) continue if (!existsSync(cronDir)) continue
const files = await readdir(cronDir) const files = await readdir(cronDir)

View File

@ -37,7 +37,7 @@ export async function executeJob(job: CronJob, onUpdate: () => void): Promise<vo
job.lastDuration = undefined job.lastDuration = undefined
onUpdate() onUpdate()
const cwd = join(APPS_DIR, job.app, 'current') const cwd = join(APPS_DIR, job.app)
forwardLog(job.app, `[cron] Running ${job.name}`) forwardLog(job.app, `[cron] Running ${job.name}`)