Project

General

Profile

Firefox reload current page caused server addEntryPoint to spawn too many entry points

Added by jupiter hce almost 3 years ago

Hi,

My web application is for manufacturing process, I need it to be run by a single thread and a single entry point. I am currently testing the example WtHome running --threads 1, it calls one WServer server(argc, argv, WTHTTP_CONFIGURATION) and one addEntryPoint:

server.addEntryPoint(EntryPointType::Application, std::bind(&createWtHomeApplication, std::placeholders::_1, blogDb.get()), "", "/css/wt/favicon.ico");

The createWtHomeApplication returns one std::make_unique(env, *blogDb);

But it created 2 WtHome instances, it called WtHome constructor twice. Every time I clicked Firefox reload current page once every time it would recreate 2 WtHome instances + n * number of reload page. Is it a bug in Wt 4.5.0 or normal behavior, how could I control and limit the entry point to only one regardless I reload current page or not?

Thank you.

Kind regards,

  • jupiter

Replies (1)

RE: Firefox reload current page caused server addEntryPoint to spawn too many entry points - Added by Korneel Dumon almost 3 years ago

Hi jupiter,

I'm not sure why your application is created twice in the beginning, but if you want to keep the same instance after reloads, you can set reload-is-new-session to false in the wt configuration.

    (1-1/1)