]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/commitdiff
wait for journal rather than polling
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 13 May 2018 13:41:16 +0000 (15:41 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 13 May 2018 13:41:16 +0000 (15:41 +0200)
modules/role/manifests/cryptoportfolio/front.pp
modules/role/templates/cryptoportfolio/api_logger.py.erb

index 3612fd5aaa5c9667cddc3afcdebd705bfa66c79e..aa57f4e16e3f581239b67cde93e20992b9742380 100644 (file)
@@ -151,6 +151,7 @@ class role::cryptoportfolio::front inherits role::cryptoportfolio {
     file { "/usr/local/bin/api_logger":
       mode    => "0755",
       content => template("role/cryptoportfolio/api_logger.py.erb"),
+      notify  => Service["cryptoportfolio-log"],
     }
     ->
     file { "/etc/systemd/system/cryptoportfolio-log.service":
@@ -158,7 +159,10 @@ class role::cryptoportfolio::front inherits role::cryptoportfolio {
       owner   => "root",
       group   => "root",
       content => template("role/cryptoportfolio/cryptoportfolio-log.service.erb"),
-      notify  => Exec["systemctl daemon-reload"],
+      notify  => [
+        Exec["systemctl daemon-reload"],
+        Service["cryptoportfolio-log"]
+      ]
     }
     ->
     service { 'cryptoportfolio-log':
index 3fb14a0feab57a4b9f3a0869717705bd22601fbb..ad296e8f429195c7ef55c5cd1c36322c037eb94c 100644 (file)
@@ -50,4 +50,4 @@ while True:
     lines = [entry["MESSAGE"] for entry in list(j)]
     if len(lines) > 0:
         send_to_discord("\n".join(lines))
-    time.sleep(3)
+    j.wait()