Python imports


In [1]:
from oneflow.base.utils.dateutils import *

from oneflow.base.tasks import *

from oneflow.core.models import *
from oneflow.core.tasks import *
from oneflow.core.stats import *

from oneflow import VERSION as version
print '1flow v%s' % version


Django found.
Django found and fields and widgets loaded.
1flow v0.25.10

Core periodic tasks


In [2]:
global_checker_task.delay()


Out[2]:
<AsyncResult: cb985a60-7bdb-486a-b429-7d60e9327bec>

Documents archiving

  • ~1min for 1000 articles, on 20131003

In [8]:
#archive_documents(1000)
archive_documents.delay()


Out[8]:
<AsyncResult: 4384d54c-7c8d-4cd7-a2fb-225683737dae>

Synchronize all statistics


In [2]:
synchronize_statsd_gauges(True)


synchronize statsd gauges for Article.* started 2013-10-26 15:31, ran in 10 seconds.
synchronize statsd gauges for Tag.* started 2013-10-26 15:32, ran in a moment.
synchronize statsd gauges for WebSite.* started 2013-10-26 15:32, ran in a moment.
synchronize statsd gauges for Author.* started 2013-10-26 15:32, ran in a moment.

Refresh access tokens


In [4]:
with benchmark():
    refresh_access_tokens()


refresh_access_tokens finished, 1/33 refreshed, 0 error(s), 32 not associated, duration: a moment.
Generic benchmark started 2013-08-28 22:23, ran in a moment.

Refresh all feeds


In [ ]:
with benchmark():
    refresh_all_feeds()

Clean Redis


In [5]:
with benchmark():
    clean_obsolete_redis_keys()


clean_obsolete_redis_keys(): finished in a moment.
Generic benchmark started 2013-07-20 13:27, ran in a moment.

Mail about closed feeds


In [9]:
with benchmark():
    global_feeds_checker()


Closed 73 feeds in a moment.
Generic benchmark started 2013-07-20 09:27, ran in 37 seconds.

Special operations

Re-open all closed feeds


In [4]:
closed_feeds = Feed.objects(closed=True)

In [5]:
closed_feeds.count(), closed_feeds


Out[5]:
(76,
 [<Feed: Aegis Media Expert Le Blog (#51c95e30e7a05b27f695d840)>, <Feed: Debian Package of the Day (#51ca0178e7a05b27f6a5a9e9)>, <Feed: Stories (#51ca0900e7a05b27f6aec47c)>, <Feed: What's Hot in Google Reader (#51ca0973e7a05b27f6aec6bb)>, <Feed: 01KiteSurf.com - Actualités du kitesurf au quotidien (#51c66183e7a05b27f68ce436)>, <Feed: mémoire de la librairie contemporaine (#51c95e35e7a05b27f695dcbf)>, <Feed: obi.1flowapp.com (#51c969ebe7a05b27f6984802)>, <Feed: Wikio - ipad2 (#51c9f2dae7a05b27f6a23f85)>, <Feed: Wikio - ces2011 (#51c9f2dae7a05b27f6a23f83)>, <Feed: Alertes Google - alkaraan (#51c9f2cde7a05b27f6a233a0)>, <Feed: Linux for Devices - RSS Feeds (#51c97299e7a05b27f69921a6)>, <Feed: All (#51ca07dae7a05b27f6aeb959)>, <Feed: Happypenguin (#51ca0087e7a05b27f6a329b7)>, <Feed: AeroXperience News (#51c9f2cde7a05b27f6a2339a)>, <Feed: AllienSoft (#51c9f2cde7a05b27f6a233a6)>, <Feed: lo-fi librarian (#51c9f2d6e7a05b27f6a23e6d)>, <Feed: (title unknown) (#51c9f2cde7a05b27f6a2335e)>, <Feed: "Top blogs - high-tech" via Prospere in Google Reader (#51c9f2cde7a05b27f6a23362)>, <Feed: (title unknown) (#51ca07c6e7a05b27f6ae9eff)>, <Feed: Amistorique (Site entier) (#51c9f2cee7a05b27f6a233ae)>, '...(remaining elements truncated)...'])

In [ ]:
for feed in closed_feeds:
    #feed.closed=False
    #feed.save()
    pass

In [ ]: