@@ -11,11 +11,13 @@ import (
11
11
// KEYS[1] - instance key
12
12
// KEYS[2] - pending events key
13
13
// KEYS[3] - history key
14
- // KEYS[4] - instances-by-creation key
14
+ // KEYS[4] - payload key
15
+ // KEYS[5] - active-instance-execution key
16
+ // KEYS[6] - instances-by-creation key
15
17
// ARGV[1] - instance segment
16
18
var deleteCmd = redis .NewScript (
17
- `redis.call("DEL", KEYS[1], KEYS[2], KEYS[3])
18
- return redis.call("ZREM", KEYS[4 ], ARGV[1])` )
19
+ `redis.call("DEL", KEYS[1], KEYS[2], KEYS[3], KEYS[4], KEYS[5] )
20
+ return redis.call("ZREM", KEYS[6 ], ARGV[1])` )
19
21
20
22
// deleteInstance deletes an instance from Redis. It does not attempt to remove any future events or pending
21
23
// workflow tasks. It's assumed that the instance is in the finished state.
@@ -26,6 +28,8 @@ func deleteInstance(ctx context.Context, rdb redis.UniversalClient, instance *co
26
28
instanceKey (instance ),
27
29
pendingEventsKey (instance ),
28
30
historyKey (instance ),
31
+ payloadKey (instance ),
32
+ activeInstanceExecutionKey (instance .InstanceID ),
29
33
instancesByCreation (),
30
34
}, instanceSegment (instance )).Err (); err != nil {
31
35
return fmt .Errorf ("failed to delete instance: %w" , err )
0 commit comments