Page MenuHomePhorge

No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None
diff --git a/lib/myhtmlex/safe.ex b/lib/myhtmlex/safe.ex
index d07291f..062aeb4 100644
--- a/lib/myhtmlex/safe.ex
+++ b/lib/myhtmlex/safe.ex
@@ -1,30 +1,35 @@
defmodule Myhtmlex.Safe do
@moduledoc false
use Application
app = Mix.Project.config[:app]
+
+ defp random_sname, do: :crypto.strong_rand_bytes(4) |> Base.encode16(case: :lower)
+
+ defp sname, do: :"myhtmlex_#{random_sname()}"
+
def start(_type, _args) do
import Supervisor.Spec
unless Node.alive? do
Nodex.Distributed.up
end
myhtml_worker = Path.join(:code.priv_dir(unquote(app)), "myhtml_worker")
children = [
- worker(Nodex.Cnode, [%{exec_path: myhtml_worker}, [name: Myhtmlex.Safe.Cnode]])
+ worker(Nodex.Cnode, [%{exec_path: myhtml_worker, sname: sname()}, [name: Myhtmlex.Safe.Cnode]])
]
Supervisor.start_link(children, strategy: :one_for_one, name: Myhtmlex.Safe.Supervisor)
end
def decode(bin) do
decode(bin, [])
end
def decode(bin, flags) do
{:ok, res} = Nodex.Cnode.call(Myhtmlex.Safe.Cnode, {:decode, bin, flags})
res
end
end

File Metadata

Mime Type
text/x-diff
Expires
Fri, Nov 29, 3:26 PM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41239
Default Alt Text
(1 KB)

Event Timeline