[cron] reload jobs on renames/deploys
This commit is contained in:
parent
565f4924e8
commit
1015e20cf9
|
|
@ -1,6 +1,6 @@
|
|||
import { Hype } from '@because/hype'
|
||||
import { define, stylesToCSS } from '@because/forge'
|
||||
import { baseStyles, ToolScript, theme } from '@because/toes/tools'
|
||||
import { baseStyles, on, ToolScript, theme } from '@because/toes/tools'
|
||||
import { discoverCronJobs } from './lib/discovery'
|
||||
import { scheduleJob, stopJob } from './lib/scheduler'
|
||||
import { executeJob } from './lib/executor'
|
||||
|
|
@ -691,6 +691,11 @@ watch(APPS_DIR, { recursive: true }, (_event, filename) => {
|
|||
debounceTimer = setTimeout(rediscover, 100)
|
||||
})
|
||||
|
||||
on(['app:activate', 'app:delete'], (event) => {
|
||||
console.log(`[cron] ${event.type} ${event.app}, rediscovering jobs...`)
|
||||
rediscover()
|
||||
})
|
||||
|
||||
init()
|
||||
|
||||
export default app.defaults
|
||||
|
|
|
|||
|
|
@ -206,6 +206,8 @@ export async function renameApp(oldName: string, newName: string): Promise<{ ok:
|
|||
renameTunnelConfig(oldName, newName)
|
||||
|
||||
update()
|
||||
emit({ type: 'app:delete', app: oldName })
|
||||
emit({ type: 'app:create', app: newName })
|
||||
|
||||
// Restart if it was running
|
||||
if (wasRunning) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"exclude": ["templates"],
|
||||
"exclude": ["apps", "templates"],
|
||||
"compilerOptions": {
|
||||
// Environment setup & latest features
|
||||
"lib": [
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user