From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id C3C651381F3 for ; Mon, 29 Jul 2013 14:57:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2877AE0ABA; Mon, 29 Jul 2013 14:57:04 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B124DE0ABA for ; Mon, 29 Jul 2013 14:56:58 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BA2A333EAB5 for ; Mon, 29 Jul 2013 14:56:57 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 1C8FDE5469 for ; Mon, 29 Jul 2013 14:56:55 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1375109758.3dae409f5f64cb96e095d9759b08cd9cf7e5fc48.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/main.py X-VCS-Directories: roverlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 3dae409f5f64cb96e095d9759b08cd9cf7e5fc48 X-VCS-Branch: master Date: Mon, 29 Jul 2013 14:56:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 96656207-d34a-4665-a173-9eb1a11bdfe7 X-Archives-Hash: 0b1cb596278d7e55e97b024909ce61f2 commit: 3dae409f5f64cb96e095d9759b08cd9cf7e5fc48 Author: André Erdmann mailerd de> AuthorDate: Mon Jul 29 14:55:58 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Mon Jul 29 14:55:58 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=3dae409f roverlay/main: optionally write stats db file --- roverlay/main.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/roverlay/main.py b/roverlay/main.py index 80a6813..04678fa 100644 --- a/roverlay/main.py +++ b/roverlay/main.py @@ -620,6 +620,12 @@ def main ( # initialize roverlay.hook roverlay.hook.setup() + # initialize database + STATS_DB_FILE = conf.get ( 'RRD_DB.file', None ) + if STATS_DB_FILE: + roverlay.stats.collector.static.setup_database ( conf ) + want_db_commit = False + # always run sync 'cause commands = {create,sync,apply_rules} # and create,apply_rules implies (no)sync run_sync() @@ -629,6 +635,12 @@ def main ( run_apply_package_rules() elif 'create' in actions: run_overlay_create() + want_db_commit = True + + + if STATS_DB_FILE and want_db_commit: + roverlay.stats.collector.static.write_db() + roverlay.hook.run ( 'db_written' ) # *** TEMPORARY ***