Skip to content

Commit

Permalink
fix: added a 30s gfal2 timeout for downloading the SRR
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Sep 12, 2024
1 parent 83219e3 commit 94e270c
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
When this is used, the OccupancyLFN has to be the full path on the storage, and not just the LFN
"""
import errno
import json
import os
import tempfile
import shutil
import errno
import tempfile

import gfal2 # pylint: disable=import-error

from DIRAC import S_OK, S_ERROR
from DIRAC import S_ERROR, S_OK
from DIRAC.Resources.Storage.GFAL2_StorageBase import setGfalSetting


class WLCGAccountingJson:
Expand Down Expand Up @@ -43,7 +45,8 @@ def _downloadJsonFile(self, occupancyLFN, filePath):
if not res["OK"]:
continue
occupancyURL = res["Value"]
ctx.filecopy(params, occupancyURL, "file://" + filePath)
with setGfalSetting(ctx, "HTTP PLUGIN", "OPERATION_TIMEOUT", 30):
ctx.filecopy(params, occupancyURL, "file://" + filePath)
# Just make sure the file is json, and not SSO HTML
with open(filePath) as f:
json.load(f)
Expand Down

0 comments on commit 94e270c

Please sign in to comment.