Skip to content

Commit 47bf3d2

Browse files
authored
immediately set entity keep alive in EntityResource (#5785)
1 parent cc54fa2 commit 47bf3d2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/plenty-hoops-stare.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@effect/cluster": patch
3+
---
4+
5+
immediately set entity keep alive in EntityResource

packages/cluster/src/EntityResource.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ export const make: <A, E, R>(options: {
7373
}) {
7474
let shuttingDown = false
7575

76+
yield* Entity.keepAlive(true)
77+
7678
const ref = yield* RcRef.make({
7779
acquire: Effect.gen(function*() {
7880
const closeable = yield* Scope.make()
@@ -85,8 +87,6 @@ export const make: <A, E, R>(options: {
8587
})
8688
)
8789

88-
yield* Entity.keepAlive(true)
89-
9090
return yield* options.acquire.pipe(
9191
Effect.provideService(CloseScope, closeable)
9292
)

0 commit comments

Comments
 (0)