File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import os
2+ import json
3+
4+ def main ():
5+ """
6+ This script is used to fix the status of the docking tasks that are in the "queued" status.
7+ It will change the status to "failed" and set the hash to "undefined" (to allow the task to be re-queued).
8+
9+ Run this script in the root directory of the tasks (e.g. /data/prankweb/docking).
10+ """
11+ for root , dirs , files in os .walk ("." ):
12+ for file in files :
13+ if file == "info.json" :
14+ try :
15+ with open (os .path .join (root , file ), "r" ) as f :
16+ changed = False
17+ content = json .load (f )
18+ if "tasks" in content :
19+ for task in content ["tasks" ]:
20+ if task ["status" ] == "queued" :
21+ task ["initialData" ]["hash" ] = "undefined"
22+ task ["status" ] = "failed"
23+ changed = True
24+
25+ if changed :
26+ print ("Changing file: " , os .path .join (root , file ))
27+ with open (os .path .join (root , file ), "w" ) as f :
28+ json .dump (content , f )
29+
30+ except Exception as e :
31+ print (f"Error in file { os .path .join (root , file )} : { e } " )
32+
33+ if __name__ == "__main__" :
34+ main ()
You can’t perform that action at this time.
0 commit comments