@@ -152,12 +152,13 @@ func testSweepProSubscriptions(region string) error {
152152func testSweepReadDatabases (client * rediscloudApi.Client , subId int ) (bool , []int , error ) {
153153 var dbIds []int
154154 list := client .Database .List (context .TODO (), subId )
155+ forceSweep := os .Getenv ("FORCE_SWEEP" ) != ""
155156
156157 for list .Next () {
157158 db := list .Value ()
158159
159- if ! redis .TimeValue (db .ActivatedOn ).Add (24 * - 1 * time .Hour ).Before (time .Now ()) {
160- // Subscription _probably_ created within the last day , so assume someone might be
160+ if ! forceSweep && ! redis .TimeValue (db .ActivatedOn ).Add (2 * - 1 * time .Hour ).Before (time .Now ()) {
161+ // Subscription _probably_ created within the last 2 hours , so assume someone might be
161162 // currently running the tests
162163 return false , nil , nil
163164 }
@@ -185,12 +186,13 @@ func testSweepReadDatabases(client *rediscloudApi.Client, subId int) (bool, []in
185186func testSweepReadEssentialsDatabases (client * rediscloudApi.Client , subId int ) (bool , []int , error ) {
186187 var dbIds []int
187188 list := client .FixedDatabases .List (context .TODO (), subId )
189+ forceSweep := os .Getenv ("FORCE_SWEEP" ) != ""
188190
189191 for list .Next () {
190192 db := list .Value ()
191193
192- if ! redis .TimeValue (db .ActivatedOn ).Add (24 * - 1 * time .Hour ).Before (time .Now ()) {
193- // Subscription _probably_ created within the last day , so assume someone might be
194+ if ! forceSweep && ! redis .TimeValue (db .ActivatedOn ).Add (2 * - 1 * time .Hour ).Before (time .Now ()) {
195+ // Subscription _probably_ created within the last 2 hours , so assume someone might be
194196 // currently running the tests
195197 return false , nil , nil
196198 }
0 commit comments