示例#1
0
                    else:
                        raise
                finally:
                    cls._procwilldelsvcs()

                now = _pyllbc_time()
                if schedule_time > 0:
                    if now - schedule_beg >= schedule_time:
                        break

                if idle_sleep:
                    elapsed = now - scheduleonce_beg
                    if elapsed < 0:
                        continue
                    elif elapsed < schedule_interval:
                        _pyllbc_sleep(schedule_interval - elapsed)
        except BaseException, e:
            raise
        finally:
            uninst_errhooker()
            cls._scheduling = False

    @classmethod
    def deschedule(cls):
        if not cls._scheduling:
            return
        elif cls._descheduling:
            return

        cls._descheduling = True
示例#2
0
文件: Service.py 项目: mr-kelly/llbc
                        return
                except Exception, e:
                    frame_exc_handler = cls._frame_exc_handler
                    if frame_exc_handler is not None:
                        tb = _sys.exc_info()[2]
                        frame_exc_handler(None, tb, e)
                    else:
                        raise
                finally:
                    cls._procwilldelsvcs()
    
                elapsed = _pyllbc_time() - schedule_beg
                if elapsed < 0:
                    continue
                elif elapsed < schedule_interval:
                    _pyllbc_sleep(schedule_interval - elapsed)
        except BaseException, e:
            raise
        finally:
            uninst_errhooker()
            cls._scheduling = False

    @classmethod
    def deschedule(cls):
        if not cls._scheduling:
            return
        elif cls._descheduling:
            return

        cls._descheduling = True