From 3553736b68e8626d4e900ebd50324b4418b3418b Mon Sep 17 00:00:00 2001 From: lxw Date: Wed, 21 Apr 2021 11:38:08 +0800 Subject: [PATCH] Change singleNode to lazy val in PrettyIdGenerator --- src/main/scala/com/softwaremill/id/pretty/IdPrettyfier.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/com/softwaremill/id/pretty/IdPrettyfier.scala b/src/main/scala/com/softwaremill/id/pretty/IdPrettyfier.scala index 383f9d2..40bb5b7 100644 --- a/src/main/scala/com/softwaremill/id/pretty/IdPrettyfier.scala +++ b/src/main/scala/com/softwaremill/id/pretty/IdPrettyfier.scala @@ -110,7 +110,7 @@ object IdPrettifier { } object PrettyIdGenerator { - val singleNode = new PrettyIdGenerator(new DefaultIdGenerator(), IdPrettifier.default) + lazy val singleNode = new PrettyIdGenerator(new DefaultIdGenerator(), IdPrettifier.default) def distributed(workerId: Long, datacenterId: Long) = new PrettyIdGenerator(new DefaultIdGenerator(workerId, datacenterId), IdPrettifier.default) }