Beispiel #1
0
 def test_force_lock_removal(self):
     test1 = ScriptTask.from_str("python -c 'print(\"test1\")'", {'store_stdout': True})
     fw = Firework(test1, {"_dupefinder": DupeFinderExact()}, fw_id=1)
     self.lp.add_wf(fw)
     # add a manual lock
     with WFLock(self.lp, 1):
         with WFLock(self.lp, 1, kill=True, expire_secs=1):
             self.assertTrue(True)  # dummy to make sure we got here
Beispiel #2
0
def unlock(args):
    lp = get_lp(args)
    fw_ids = parse_helper(lp, args, wf_mode=True)
    for f in fw_ids:
        with WFLock(lp, f, expire_secs=0, kill=True):
            lp.m_logger.warn('FORCIBLY RELEASING LOCK DUE TO USER COMMAND, WF: {}'.format(f))
            lp.m_logger.debug('Processed Workflow with fw_id: {}'.format(f))
    lp.m_logger.info('Finished unlocking {} Workflows'.format(len(fw_ids)))