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')
}
const cronDir = join(APPS_DIR, appName, 'current', 'cron')
const cronDir = join(APPS_DIR, appName, 'cron')
const filePath = join(cronDir, `${name}.ts`)
// Check if file already exists

View File

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

View File

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