mirror of
https://github.com/wekan/wekan.git
synced 2025-12-21 18:00:12 +01:00
Prevent the capnproto connection from getting garbage collected.
This commit is contained in:
parent
95680ef43a
commit
4d6ab3094c
1 changed files with 2 additions and 1 deletions
|
|
@ -28,10 +28,11 @@ if (isSandstorm && Meteor.isServer) {
|
||||||
Capnp.importSystem('sandstorm/sandstorm-http-bridge.capnp').SandstormHttpBridge;
|
Capnp.importSystem('sandstorm/sandstorm-http-bridge.capnp').SandstormHttpBridge;
|
||||||
|
|
||||||
let httpBridge = null;
|
let httpBridge = null;
|
||||||
|
let capnpConnection = null;
|
||||||
|
|
||||||
function getHttpBridge() {
|
function getHttpBridge() {
|
||||||
if (!httpBridge) {
|
if (!httpBridge) {
|
||||||
const capnpConnection = Capnp.connect('unix:/tmp/sandstorm-api');
|
capnpConnection = Capnp.connect('unix:/tmp/sandstorm-api');
|
||||||
httpBridge = capnpConnection.restore(null, SandstormHttpBridge);
|
httpBridge = capnpConnection.restore(null, SandstormHttpBridge);
|
||||||
}
|
}
|
||||||
return httpBridge;
|
return httpBridge;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue