Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sweep:integration] RSS fix: delete the occupancy cache only for older entries #7755

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/DIRAC/ResourceStatusSystem/Command/FreeDiskSpaceCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@
For the moment, when you see "token" or "space token" here, just read "StorageElement".

"""
import sys
import errno
import sys
from datetime import datetime, timedelta, timezone

from datetime import datetime

from DIRAC import S_OK, S_ERROR
from DIRAC.Core.Utilities.File import convertSizeUnits
from DIRAC import S_ERROR, S_OK
from DIRAC.AccountingSystem.Client.DataStoreClient import gDataStoreClient
from DIRAC.AccountingSystem.Client.Types.StorageOccupancy import StorageOccupancy
from DIRAC.Core.Utilities.File import convertSizeUnits
from DIRAC.DataManagementSystem.Utilities.DMSHelpers import DMSHelpers
from DIRAC.ResourceStatusSystem.Command.Command import Command
from DIRAC.ResourceStatusSystem.Utilities import CSHelpers
from DIRAC.Resources.Storage.StorageElement import StorageElement
from DIRAC.ResourceStatusSystem.Client.ResourceManagementClient import ResourceManagementClient
from DIRAC.ResourceStatusSystem.Command.Command import Command
from DIRAC.ResourceStatusSystem.Utilities import CSHelpers


class FreeDiskSpaceCommand(Command):
Expand Down Expand Up @@ -204,7 +203,9 @@ def _cleanCommand(self, toDelete=None):
if not toDelete:
toDelete = []

res = self.rmClient.selectSpaceTokenOccupancyCache()
res = self.rmClient.selectSpaceTokenOccupancyCache(
meta={"older": ["LastCheckTime", datetime.now(timezone.utc) - timedelta(hours=6)]}
)
if not res["OK"]:
return res
storedSEsSet = {(sse[0], sse[1]) for sse in res["Value"]}
Expand Down
Loading