Skip to content

Commit fa43318

Browse files
authored
Merge pull request #8189 from chrisburr/sandbox-store-cleaning
[9.0] Don't clean sandboxes which are on S3
2 parents 44c5e0d + 15c7c39 commit fa43318

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/DIRAC/WorkloadManagementSystem/DB/SandboxMetadataDB.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ def getUnusedSandboxes(self):
309309
"TIMESTAMPDIFF( DAY, LastAccessTime, UTC_TIMESTAMP() ) >= %d" % self.__assignedSBGraceDays,
310310
f"! Assigned AND TIMESTAMPDIFF( DAY, LastAccessTime, UTC_TIMESTAMP() ) >= {self.__unassignedSBGraceDays}",
311311
]
312-
sqlCmd = f"SELECT SBId, SEName, SEPFN FROM `sb_SandBoxes` WHERE ( {' ) OR ( '.join(sqlCond)} )"
312+
# Exclude sandboxes that are in S3 as those are handled by DiracX
313+
sqlCmd = f"SELECT SBId, SEName, SEPFN FROM `sb_SandBoxes` WHERE SEPFN not like '/S3/%' AND (( {' ) OR ( '.join(sqlCond)} ))"
313314
return self._query(sqlCmd)
314315

315316
def deleteSandboxes(self, SBIdList):

0 commit comments

Comments
 (0)