Commit a01f5830 authored by jan.koester's avatar jan.koester
Browse files

test

parent 2fd83f92
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ function getMod(scriptPath) {
  return { mod, p };
}

globalThis.__blogiEmbeddedRun = async function(reqPath, resPath) {
globalThis.__blogiEmbeddedRun = function(reqPath, resPath) {
  try {
    const req = JSON.parse(fs.readFileSync(reqPath, 'utf8'));
    const hook = (typeof req.hook === 'string' && req.hook) ? req.hook : 'render';
@@ -60,7 +60,7 @@ globalThis.__blogiEmbeddedRun = async function(reqPath, resPath) {
      return true;
    }

    const result = await Promise.resolve(fn(req));
    const result = fn(req);

    if (hook === 'metadata' && result && typeof result === 'object') {
      if (!result.type_id || typeof result.type_id !== 'string' || !result.type_id.trim()) {
@@ -132,13 +132,7 @@ public:
            return 1;
        }

        auto loopResult = node::SpinEventLoop(setup_->env());
        if (loopResult.IsNothing()) {
            std::cerr << "Node embedded runtime error: SpinEventLoop returned no exit code" << std::endl;
            return 1;
        }

        return loopResult.FromJust();
        return 0;
    }

private: