8062fddc23
update_portage_tree() now: - watch stderr and stdout for each command - use layman command instead of layman API for sync because layman API doesn't work when stdout or stderr is not a real file (we could probably work around that with pipes and epoll) - use egencache instead of emerge to generate cache - export PORTAGE_CONFIGROOT, ROOT, EIX_CACHEFILE etc.. so they are used everywhere Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
31 lines
985 B
Python
31 lines
985 B
Python
from djeuscan.models import HerdLog, MaintainerLog, CategoryLog, WorldLog
|
|
from djeuscan import charts
|
|
|
|
from djeuscan.processing import FakeLogger
|
|
|
|
def regen_rrds(logger=None):
|
|
"""
|
|
Regenerates the rrd database
|
|
"""
|
|
|
|
if logger is None:
|
|
logger = FakeLogger()
|
|
|
|
logger.info("Regenering RRDs for world")
|
|
for wlog in WorldLog.objects.all():
|
|
charts.rrd_update('world', wlog.datetime, wlog)
|
|
|
|
logger.info("Regenering RRDs for categories")
|
|
for clog in CategoryLog.objects.all():
|
|
charts.rrd_update('category-%s' % clog.category,
|
|
clog.datetime, clog)
|
|
|
|
logger.info("Regenering RRDs for herds")
|
|
for hlog in HerdLog.objects.all():
|
|
charts.rrd_update('herd-%d' % hlog.herd.id, hlog.datetime, hlog)
|
|
|
|
logger.info("Regenering RRDs for maintainers")
|
|
for mlog in MaintainerLog.objects.all():
|
|
charts.rrd_update('maintainer-%d' % mlog.maintainer.id,
|
|
mlog.datetime, mlog)
|