Skip to content

Commit

Permalink
Merge pull request #186 from ICRAR/LIU-276
Browse files Browse the repository at this point in the history
Changes NGAS reproduce data
  • Loading branch information
pritchardn committed Jul 27, 2022
2 parents 44f6c1f + 93f9645 commit 1e5eb35
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions daliuge-engine/dlg/drop.py
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,7 @@ class NgasDROP(DataDROP):
ngasConnectTimeout = dlg_int_param("ngasConnectTimeout", 2)
ngasMime = dlg_string_param("ngasMime", "application/octet-stream")
len = dlg_int_param("len", -1)
ngas_checksum = None

def initialize(self, **kwargs):
if self.len == -1:
Expand Down Expand Up @@ -1785,6 +1786,7 @@ def setCompleted(self):
"Setting size of NGASDrop %s to %s", self.fileId, stat["FileSize"]
)
self._size = int(stat["FileSize"])
self.ngas_checksum = str(stat["Checksum"])
except:
# we''ll try this again in case there is some other issue
# try:
Expand All @@ -1808,11 +1810,9 @@ def dataURL(self) -> str:

# Override
def generate_reproduce_data(self):
# TODO: This is a bad implementation. Will need to sort something better out
from .droputils import allDropContents

data = allDropContents(self, self.size)
return {"data_hash": common_hash(data)}
if self.ngas_checksum is None or self.ngas_checksum == '':
return {"fileid": self.ngasFileId, "size": self._size}
return {"data_hash": self.ngas_checksum}


##
Expand Down

0 comments on commit 1e5eb35

Please sign in to comment.