From b185799446e79bc141318ca5d2fcf901c87d5739 Mon Sep 17 00:00:00 2001 From: "Brian J. Cardiff" Date: Wed, 22 Feb 2017 13:41:18 -0300 Subject: [PATCH] fix build deferring agent initialization ref #3988 --- src/compiler/crystal/tools/playground/server.cr | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/compiler/crystal/tools/playground/server.cr b/src/compiler/crystal/tools/playground/server.cr index b0f46d1f69d0..e1139d35f136 100644 --- a/src/compiler/crystal/tools/playground/server.cr +++ b/src/compiler/crystal/tools/playground/server.cr @@ -23,10 +23,8 @@ module Crystal::Playground require "compiler/crystal/tools/playground/agent" class Crystal::Playground::Agent - @@instance = Crystal::Playground::Agent.new("ws://localhost:#{port}/agent/#{session_key}/#{tag}", #{tag}) - def self.instance - @@instance + @@instance ||= Crystal::Playground::Agent.new("ws://localhost:#{port}/agent/#{session_key}/#{tag}", #{tag}) end end