def _discoro_timer_proc(coro=None):
        from asyncoro.discoro import DiscoroNodeAvailInfo
        coro.set_daemon()
        last_pulse = last_proc_check = time.time()
        interval = pulse_coro = None
        for peer in _discoro_peers:
            yield asyncoro.AsynCoro.instance().peer(peer)
        while 1:
            msg = yield coro.receive(timeout=interval)
            now = time.time()
            if msg:
                pulse_coro = msg.get('pulse_coro', None)
                interval = msg.get('interval', None)
                disk_path = msg.get('disk_path', '.')
                if not isinstance(pulse_coro, asyncoro.Coro):
                    interval = None
                    continue
                last_pulse = now
                continue
                # TODO: monitor servers
            if not pulse_coro:
                continue

            msg = {'location': coro.location}
            if psutil:
                msg['node_status'] = DiscoroNodeAvailInfo(
                    coro.location.addr, 100.0 - psutil.cpu_percent(),
                    psutil.virtual_memory().available, psutil.disk_usage(disk_path).free,
                    100.0 - psutil.swap_memory().percent)

            if (yield pulse_coro.deliver(msg, timeout=2)) == 1:
                last_pulse = now
            elif (now - last_pulse) > (5 * interval):
                asyncoro.logger.warning('scheduler is not reachable; closing computation')
                for _discoro_server_info in _discoro_server_infos:
                    _discoro_server_info.Queue.put({'req': 'close', 'auth': _discoro_auth})

            if (3 * interval) > (now - last_proc_check):
                last_proc_check = now
                for _discoro_server_info in _discoro_server_infos:
                    if not _discoro_server_info.Proc.is_alive():
                        # TODO: inform scheduler, start new process
                        asyncoro.logger.warning('Process %s is dead?: %s',
                                                _discoro_server_info.Proc.pid,
                                                _discoro_server_info.Proc.exitcode)
dataset/ETHPy150Open pgiri/asyncoro/py2/asyncoro/discoronode.py/_discoro_timer_proc/swapped operands of `>`