Remove current symlink indirection from cron paths
This commit is contained in:
parent
f5c5102fc8
commit
09f421ecb9
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -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}`)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user