ncolony/client/heart.py
def makeService():
    """Make a service

    :returns: an IService
    """
    configJSON = os.environ.get('NCOLONY_CONFIG')
    if configJSON is None:
        return None
    config = json.loads(configJSON)
    params = config.get('ncolony.beatcheck')
    if params is None:
        return None
    myFilePath = filepath.FilePath(params['status'])
    if myFilePath.isdir():
        name = os.environ['NCOLONY_NAME']
        myFilePath = myFilePath.child(name)
    heart = Heart(myFilePath)
    ret = tainternet.TimerService(params['period']/3, heart.beat)
    return ret
def makeService():
    """Make a service

    :returns: an IService
    """
    configJSON = os.environ.get('NCOLONY_CONFIG')
    if configJSON is None:
        return None
    config = json.loads(configJSON)
    params = config.get('ncolony.beatcheck')
    if params is None:
        return None
    myFilePath = filepath.FilePath(params['status'])
    if myFilePath.isdir():
        name = os.environ['NCOLONY_NAME']
        myFilePath = myFilePath.child(name)
    heart = Heart(myFilePath)
    ret = tainternet.TimerService(params['period']/3, heart.beat)
    return ret
Make a service

    :returns: an IService