@@ -11,11 +11,13 @@ import (
1111// KEYS[1] - instance key
1212// KEYS[2] - pending events key
1313// 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
1517// ARGV[1] - instance segment
1618var 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])` )
1921
2022// deleteInstance deletes an instance from Redis. It does not attempt to remove any future events or pending
2123// 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
2628 instanceKey (instance ),
2729 pendingEventsKey (instance ),
2830 historyKey (instance ),
31+ payloadKey (instance ),
32+ activeInstanceExecutionKey (instance .InstanceID ),
2933 instancesByCreation (),
3034 }, instanceSegment (instance )).Err (); err != nil {
3135 return fmt .Errorf ("failed to delete instance: %w" , err )
0 commit comments