Skip to content

Commit

Permalink
Merge pull request #9 from arahlin/fix_gil_release
Browse files Browse the repository at this point in the history
Release the GIL after initializing tuber_resource
  • Loading branch information
gsmecher authored Mar 7, 2024
2 parents 054c76f + 8a2d5d7 commit f6c5c86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,6 @@ int main(int argc, char **argv) {
/* Create a registry */
py::dict reg = py::eval("registry");

py::gil_scoped_release release;

/*
* Start webserver
*/
Expand All @@ -524,6 +522,8 @@ int main(int argc, char **argv) {
tr->set_allowing(MHD_HTTP_METHOD_POST, true);
ws->register_resource("/tuber", tr.get());

py::gil_scoped_release release;

/* If a valid webroot was provided, serve static content for other paths. */
try {
fr = std::make_unique<file_resource>(fs::canonical(webroot), max_age);
Expand Down

0 comments on commit f6c5c86

Please sign in to comment.