Skip to content

After the web server started, Prisma was immediately shut down #7

@medz

Description

@medz

https://github.com/necodeIT/license_server/blob/688e162bae36dc35ee96bd0200118aab05221143/bin/main.dart#L54-L56

ref: medz/dart-orm#437

@mcquenji https://github.com/necodeIT/license_server/blob/main/bin/main.dart#L55

I noticed that you shut down the engine in main. This approach is suitable for disposable apps (such as CLI), for Web Server application you should shut it down in the logic that confirms your web server exits.

Or you don't need to shut down the database query engine (it just has a certain probability that the child process will not be shut down after the Dart process exits unexpectedly. This has no impact on the official deployment, it only occurs when the system is frequently shut down and started during development.)

Warning

For Web Server, we should not shut down the query engine immediately after starting it. The correct approach is to ignore it or shut down the query engine in the logic that ensures the main process exits (however, Dart currently does not have a hook to ensure the main program exits)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions