chiark / gitweb /
journal: Leave server_dispatch_message early when Storage is none
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>
Thu, 18 Jul 2013 12:45:12 +0000 (14:45 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 18 Jul 2013 17:55:11 +0000 (19:55 +0200)
When using Storage=none there is no point in collecting all the
information just to throw them away. After this change journald
consumes a lot less CPU time when only forwarding messages.

src/journal/journald-server.c

index 332ba41363e842293bf99b590f31daa87ca78cb2..81de9596664bca69d627067ed95862ae3067720f 100644 (file)
@@ -845,6 +845,11 @@ void server_dispatch_message(
         if (LOG_PRI(priority) > s->max_level_store)
                 return;
 
+        /* Stop early in case the information will not be stored
+         * in a journal. */
+        if (s->storage == STORAGE_NONE)
+                return;
+
         if (!ucred)
                 goto finish;