Unify signatures

This commit is contained in:
Jonatan Kłosko 2022-09-16 23:10:42 +02:00
parent 71fba9b523
commit 7cd7defa6c
5 changed files with 12 additions and 12 deletions

View file

@ -476,7 +476,7 @@ defprotocol Livebook.Runtime do
Sets the given environment variables.
"""
@spec put_system_envs(t(), list({String.t(), String.t()})) :: :ok
def put_system_envs(runtime, env_vars)
def put_system_envs(runtime, envs)
@doc """
Unsets the given environment variables.

View file

@ -124,8 +124,8 @@ defimpl Livebook.Runtime, for: Livebook.Runtime.Attached do
raise "not supported"
end
def put_system_envs(runtime, secrets) do
RuntimeServer.put_system_envs(runtime.server_pid, secrets)
def put_system_envs(runtime, envs) do
RuntimeServer.put_system_envs(runtime.server_pid, envs)
end
def delete_system_envs(runtime, names) do

View file

@ -221,8 +221,8 @@ defimpl Livebook.Runtime, for: Livebook.Runtime.ElixirStandalone do
Livebook.Runtime.Dependencies.search_packages_on_hex(send_to, search)
end
def put_system_envs(runtime, secrets) do
RuntimeServer.put_system_envs(runtime.server_pid, secrets)
def put_system_envs(runtime, envs) do
RuntimeServer.put_system_envs(runtime.server_pid, envs)
end
def delete_system_envs(runtime, names) do

View file

@ -122,8 +122,8 @@ defimpl Livebook.Runtime, for: Livebook.Runtime.Embedded do
Livebook.Runtime.Dependencies.search_packages_in_list(packages, send_to, search)
end
def put_system_envs(runtime, secrets) do
RuntimeServer.put_system_envs(runtime.server_pid, secrets)
def put_system_envs(runtime, envs) do
RuntimeServer.put_system_envs(runtime.server_pid, envs)
end
def delete_system_envs(runtime, names) do

View file

@ -169,9 +169,9 @@ defmodule Livebook.Runtime.ErlDist.RuntimeServer do
@doc """
Sets the given environment variables.
"""
@spec put_system_envs(pid(), map()) :: :ok
def put_system_envs(pid, secrets) do
GenServer.cast(pid, {:put_system_envs, secrets})
@spec put_system_envs(pid(), list({String.t(), String.t()})) :: :ok
def put_system_envs(pid, envs) do
GenServer.cast(pid, {:put_system_envs, envs})
end
@doc """
@ -476,8 +476,8 @@ defmodule Livebook.Runtime.ErlDist.RuntimeServer do
{:noreply, state}
end
def handle_cast({:put_system_envs, secrets}, state) do
System.put_env(secrets)
def handle_cast({:put_system_envs, envs}, state) do
System.put_env(envs)
{:noreply, state}
end