From 34180eba939fd42cc5063e4f63bc9b7cdc4fc784 Mon Sep 17 00:00:00 2001
From: Sam <sam.saffron@gmail.com>
Date: Tue, 11 Nov 2014 10:28:17 +1100
Subject: [PATCH] FIX: official benchmark crashing while populating db

---
 config/environments/profile.rb | 5 +++++
 script/profile_db_generator.rb | 5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/config/environments/profile.rb b/config/environments/profile.rb
index 9cc7d7e7e21..43531b0d5c1 100644
--- a/config/environments/profile.rb
+++ b/config/environments/profile.rb
@@ -43,6 +43,11 @@ Discourse::Application.configure do
   # allows users to use mini profiler
   config.load_mini_profiler = false
 
+  # we don't need full logster support, but need to keep it working
+  config.after_initialize do
+    Logster.logger = Rails.logger
+  end
+
   # for profiling with perftools
   # config.middleware.use ::Rack::PerftoolsProfiler, default_printer: 'gif'
 end
diff --git a/script/profile_db_generator.rb b/script/profile_db_generator.rb
index 2912ff5486d..b9de3618ff2 100644
--- a/script/profile_db_generator.rb
+++ b/script/profile_db_generator.rb
@@ -95,9 +95,10 @@ puts
 puts "Creating 100 topics"
 
 topic_ids = 100.times.map do
-  topic = PostCreator.create(users.sample, raw: sentence, title: sentence[0..50].strip, category:  categories.sample.name, skip_validations: true)
+  post = PostCreator.create(users.sample, raw: sentence, title: sentence[0..50].strip, category:  categories.sample.name, skip_validations: true)
+
   putc "."
-  topic.id
+  post.topic_id
 end
 
 puts