コード例 #1
0
ファイル: tasks.py プロジェクト: pchennz/KEEN-full
def update_visibility(aid):
    """
    Pulls the existing activity and then pushes it again
    
    """
    logger.warning('update_visibility aid:%s' % aid)
    logger.warning('update_visibility aid:%s pulling' % aid)
    Activity.pull(aid, confirmed = False)
    logger.warning('update_visibility aid:%s pushing' % aid)
    push_activity(aid)
    logger.warning('update_visibility aid:%s pushed' % aid)
コード例 #2
0
ファイル: tasks.py プロジェクト: pchennz/KEEN-full
def pull_confirmed_activity_later(aid):
    """
    Pulls the activity from confirmed users
    Will be called by task eta to be activity when + CONFIRMED_USER_PULL_HOURS
    """
    success = Activity.pull(aid, confirmed = True)
    worked = 'successfully' if success else 'not successfully'
    return "pull_confirmed_activity_later on %s %s" % (str(aid), worked)
コード例 #3
0
ファイル: tasks.py プロジェクト: pchennz/KEEN-full
def pull_default(aid):
    """
    Default task called after DEFAULT_USER_PULL_HOURS
    Pulls activity from non confirmed users unless it's confirmed
    """
#    activity = Activity.objects.get(id = aid)
    success = Activity.pull(aid)
    logger.warning('pull_default aid:%s removed from cardstores' % aid)
#    if not activity.is_confirmed():
#        success = Activity.pull(aid, confirmed = True)
#        return "Default pull_non_confirmed on %s not applied, as will be pulled by a later task" % str(aid)
#    worked = 'successfully' if success else 'not successfully'
    return True
コード例 #4
0
ファイル: tasks.py プロジェクト: pchennz/KEEN-full
def pull_all(aid):
    success_1 = Activity.pull(aid, confirmed = False)
    success_2 = Activity.pull(aid, confirmed = True)
    return "%s %s %s" % (str(aid), str(success_1), str(success_2))