mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 12:14:33 +01:00
44 lines
1.2 KiB
TypeScript
Executable File
44 lines
1.2 KiB
TypeScript
Executable File
import type { ApplicationContract } from '@ioc:Adonis/Core/Application'
|
|
import Logger from '@ioc:Adonis/Core/Logger'
|
|
export default class AppProvider {
|
|
public static needsApplication = true
|
|
|
|
constructor(protected app: ApplicationContract) {
|
|
}
|
|
|
|
public register() {
|
|
// Register your own bindings
|
|
}
|
|
|
|
public async boot() {
|
|
// IoC container is ready
|
|
Logger.info('Application is booting. Please wait...')
|
|
}
|
|
|
|
public async ready() {
|
|
// App is ready
|
|
const StatsTask = await import('App/Tasks/StatsTask')
|
|
const StatesTask = await import('App/Tasks/StatesTask')
|
|
const CurrentSongTask = await import('App/Tasks/CurrentSongTask')
|
|
|
|
await StatsTask.Activate()
|
|
await StatesTask.Activate()
|
|
await CurrentSongTask.Activate()
|
|
|
|
Logger.info('Application is ready!')
|
|
}
|
|
|
|
public async shutdown() {
|
|
// Cleanup, since app is going down
|
|
const StatsTask = await import('App/Tasks/StatsTask')
|
|
const StatesTask = await import('App/Tasks/StatesTask')
|
|
const CurrentSongTask = await import('App/Tasks/CurrentSongTask')
|
|
|
|
await StatsTask.ShutDown()
|
|
await StatesTask.ShutDown()
|
|
await CurrentSongTask.ShutDown()
|
|
|
|
Logger.info('Application is closing. Bye...')
|
|
}
|
|
}
|