shutdown method

Future<void> shutdown()

Initiates graceful shutdown of the application.

Currently logs shutdown message. Extend to close DB connections, stop servers, flush caches, etc.

Implementation

Future<void> shutdown() async {
  status = AppStatus.shutdown;
  print('Shutting down...');

  await PostgresModel.database?.close(force: true);
  await AppKernel.server?.close(force: true);

  await container.dispose();

}