summaryrefslogtreecommitdiff
path: root/pool/supervisor_pool.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-12-23 20:57:41 +0300
committerValery Piashchynski <[email protected]>2021-12-23 20:57:41 +0300
commit5a9c81a4aee940a9bc476f2f3bafd13b411e2786 (patch)
treed53386065c22bd624bb8f92cb5733d6e728221d7 /pool/supervisor_pool.go
parent31112495808ae37f38f7b514de1f40b8b8a75238 (diff)
add Reset method to the pool
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'pool/supervisor_pool.go')
-rwxr-xr-xpool/supervisor_pool.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pool/supervisor_pool.go b/pool/supervisor_pool.go
index 5f87c8a4..0502dc9a 100755
--- a/pool/supervisor_pool.go
+++ b/pool/supervisor_pool.go
@@ -51,6 +51,12 @@ func (sp *supervised) execWithTTL(_ context.Context, _ *payload.Payload) (*paylo
panic("used to satisfy pool interface")
}
+func (sp *supervised) Reset(ctx context.Context) error {
+ sp.mu.Lock()
+ defer sp.mu.Unlock()
+ return sp.pool.Reset(ctx)
+}
+
func (sp *supervised) Exec(rqs *payload.Payload) (*payload.Payload, error) {
const op = errors.Op("supervised_exec_with_context")
if sp.cfg.ExecTTL == 0 {