MCPcopy Index your code
hub / github.com/diffgram/diffgram / declare_success

Method declare_success

walrus/methods/input/process_media.py:1323–1356  ·  view source on GitHub ↗

Caution, for video we are assuming this is the "parent_input" we bounce between self.input and input It's possible for this to be called multiple times? So if it's already success just return

(
        self,
        input: Input)

Source from the content-addressed store, hash-verified

1321 return parent_input
1322
1323 def declare_success(
1324 self,
1325 input: Input):
1326 """
1327 Caution, for video we are assuming this is the "parent_input"
1328 we bounce between self.input and input
1329
1330 It's possible for this to be called multiple times?
1331 So if it's already success just return
1332 """
1333
1334 if input.status == "success":
1335 return
1336 if input.file_id is None and input.file is not None:
1337 input.file_id = input.file.id
1338
1339 logger.debug(f'Success Processing Input: {input.id} {input.mode} - {input.type}')
1340 Event.new_deferred(
1341 session = self.session,
1342 kind = 'input_file_uploaded',
1343 project_id = input.project_id,
1344 directory_id = input.directory_id,
1345 input_id = input.id,
1346 file_id = input.file_id,
1347 wait_for_commit = True
1348 )
1349 input.percent_complete = 100
1350 input.status = "success"
1351 input.time_completed = datetime.datetime.utcnow()
1352
1353 if input.batch_id is not None:
1354 input.batch.check_for_completion_and_complete(self.session)
1355
1356 return input
1357
1358 def update_sequences(self):
1359 """

Callers 10

__copy_videoMethod · 0.95
__copy_fileMethod · 0.95
process_geo_tiff_fileMethod · 0.95
video_status_updatesMethod · 0.95
process_one_text_fileMethod · 0.95

Calls 2

new_deferredMethod · 0.80

Tested by

no test coverage detected