Skip to content

Commit

Permalink
Restart actors
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Candeia <[email protected]>
  • Loading branch information
mcandeia committed Nov 20, 2024
1 parent 3b3dc3b commit dd2af3b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/actors/hono/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ export const withActors = (
? new ActorRuntime(rtOrActors)
: rtOrActors;
return async (ctx, next) => {
if (!ctx.req.path.startsWith(basePath)) {
const path = ctx.req.path;
if (!path.startsWith(basePath)) {
return next();
}
if (path.endsWith(`${basePath}/__restart`)) {
console.log("Restarting actors...");
Deno.exit(1);
}
const response = await rt.fetch(ctx.req.raw);
ctx.res = response;
};
Expand Down

0 comments on commit dd2af3b

Please sign in to comment.