def main(options):
    """
    :param options: optparse options
    """
    tl = GlobalTimeline()

    # Update last 24 hours for every hour (this makes sure we will not miss any events)
    tl.refresh_today(update=options.update)

    # Clean up old events from the timeline. For now we keep only last 60 days.
    tl.clean_up(days_to_keep=options.days)

    # Clear cache
    cache = TimelineCache()
    cache.clear()
def main(options):
    """
    :param options: optparse options
    """
    tl = GlobalTimeline()

    # Update last 24 hours for every hour (this makes sure we will not miss any events)
    tl.refresh_today(update=options.update)

    # Clean up old events from the timeline. For now we keep only last 60 days.
    tl.clean_up(days_to_keep=options.days)

    # Clear cache
    cache = TimelineCache()
    cache.clear()
Exemple #3
0
def _notify_event_occurred(project_identifier, event_type):
    """ This function will notify / invoke actions about the
    fact that anything happened in a project

    For now implemented here. In the future could be extensible through some interface.
    """
    from multiproject.home.timeline.api import GlobalTimeline
    gtl = GlobalTimeline()
    now = datetime.datetime.now(datefmt.localtz)
    update = False
    filters = None

    # Two hours back should be more than enough and also take one
    # hour to the future to make absolute sure that event is not missed
    past = now - datetime.timedelta(hours = 2)

    # Previously, if files events were noticed, the whole cache was updated.
    # That seemed to be too heavy operation to clear all events when files tab is updated.
    # Let's just accept, that there might be broken links in global timeline cache.

    future = now + datetime.timedelta(hours = 1)
    gtl.refresh_project(project_identifier, past, future, filters, update)
    cache = TimelineCache()
    cache.clear()
def _notify_event_occurred(project_identifier, event_type):
    """ This function will notify / invoke actions about the
    fact that anything happened in a project

    For now implemented here. In the future could be extensible through some interface.
    """
    from multiproject.home.timeline.api import GlobalTimeline
    gtl = GlobalTimeline()
    now = datetime.datetime.now(datefmt.localtz)
    update = False
    filters = None

    # Two hours back should be more than enough and also take one
    # hour to the future to make absolute sure that event is not missed
    past = now - datetime.timedelta(hours=2)

    # Previously, if files events were noticed, the whole cache was updated.
    # That seemed to be too heavy operation to clear all events when files tab is updated.
    # Let's just accept, that there might be broken links in global timeline cache.

    future = now + datetime.timedelta(hours=1)
    gtl.refresh_project(project_identifier, past, future, filters, update)
    cache = TimelineCache()
    cache.clear()