code: def do_run_one(self, args):
          '''run a single job'''
          work_spec_names = args.from_work_spec or None
          worker = SingleWorker(self.config, task_master=self.task_master, work_spec_names=work_spec_names, max_jobs=args.max_jobs)
          worker.register()
          rc = False
          starttime = time.time()
          count = 0
          try:
              while True:
                  rc = worker.run()
                  if not rc:
                      break
                  count += 1
                  if (args.limit_seconds is None) and (args.limit_count is None):
                      # only do one
                      break
                  if (args.limit_seconds is not None) and ((time.time() - starttime) >= args.limit_seconds):
                      break
                  if (args.limit_count is not None) and (count >= args.limit_count):
                      break
          finally:
              worker.unregister()
          if not rc:
              self.exitcode = f do_run_one(self, args):
          '''run a single job'''
          work_spec_names = args.from_work_spec or None
          worker = SingleWorker(self.config, task_master=self.task_master, work_spec_names=work_spec_names, max_jobs=args.max_jobs)
          worker.register()
          rc = False
          starttime = time.time()
          count = 0
          try:
              while True:
                  rc = worker.run()
                  if not rc:
                      break
                  count += 1
                  if (args.limit_seconds is None) and (args.limit_count is None):
                      # only do one
                      break
                  if (args.limit_seconds is not None) and ((time.time() - starttime) >= args.limit_seconds):
                      break
                  if (args.limit_count is not None) and (count >= args.limit_count):
                      break
          finally:
              worker.unregister()
          if not rc:
              self.exitcode = 2
docs: run a single job