Merge branch 'fix-cron-directory'
This commit is contained in:
commit
6e5d665846
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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}`)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user