Skip to content

Commit

Permalink
Fix async context timer issue
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Feb 24, 2020
1 parent 4d72e13 commit a0ea9e6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion shell/app/node_main.cc
Expand Up @@ -152,9 +152,12 @@ int NodeMain(int argc, char* argv[]) {
node_debugger.Start();

node::BootstrapEnvironment(env);

// TODO(codebytere): we shouldn't have to call this - upstream?
env->InitializeDiagnostics();

// This is needed in order to enable v8 host weakref hooks.
// TODO(codebytere): we shouldn't have to call this - upstream?
gin_env.isolate()->SetHostCleanupFinalizationGroupCallback(
HostCleanupFinalizationGroupCallback);

Expand All @@ -181,7 +184,13 @@ int NodeMain(int argc, char* argv[]) {
versions.SetReadOnly(ELECTRON_PROJECT_NAME, ELECTRON_VERSION_STRING);
}

node::LoadEnvironment(env);
{
node::AsyncCallbackScope callback_scope(env);
env->async_hooks()->push_async_ids(1, 0);
node::LoadEnvironment(env);
env->async_hooks()->pop_async_id(1);
}

v8::Isolate* isolate = env->isolate();

{
Expand Down

0 comments on commit a0ea9e6

Please sign in to comment.