Beispiel #1
0
def request_for_update(request):
  """Trigger the collection of news from all known feeds and the cleanup
  of all references that have never been saved (past an arbitrary
  delay).
  """
  delete_old_references(datetime.now(timezone.utc)-NEWS_TIME_THRESHOLD)
  collect_news_from_feeds()
  if settings.DEMO:
    # keep only a short number of refs (the most recent) to avoid bloating the demo
    with transaction.commit_on_success():
      for ref in list(Reference.objects\
                      .filter(save_count=0)\
                      .order_by("-pub_date")[MAX_ITEMS_PER_PAGE:]):
        ref.delete()
  return HttpResponseRedirect(reverse("wom_user.views.home"))
Beispiel #2
0
def collect_all_new_references_regularly():
    collect_news_from_feeds()
Beispiel #3
0
def collect_all_new_references_regularly():
  collect_news_from_feeds()