Ejemplo n.º 1
0
    def __init__(self, uid, jobs_maximum, timeout_seconds, trace=False):
        self.uid = uid or get_instance_name()
        self.timeout_seconds = timeout_seconds
        self.trace = trace
        self.jobs_maximum = jobs_maximum
        self.jobs = []

        self.lock_thread = threading.Lock()
        self.ping_event = threading.Event()
        self.ping_thread = threading.Thread(target=self.ping)
        self.ping_thread.start()

        self.busy_time = datetime.utcnow()
Ejemplo n.º 2
0
def worker_downscale():
    name = get_instance_name()
    if name != 'UNKNOWN':
        group_instances_delete(name)
Ejemplo n.º 3
0
def worker_downscale():
    try:
        group_instances_delete(get_instance_name())
    except HttpError as e:
        log_manager_error('WORKER DOWNSCALE NOT AVAILABLE: %s' % str(e))