1
0
Fork 0
mirror of https://github.com/benbusby/farside.git synced 2025-06-08 10:26:36 +00:00

run as local service

This commit is contained in:
mithereal 2022-07-30 21:11:54 -07:00
parent 876bc2136b
commit e9cca35a54
10 changed files with 111 additions and 22 deletions

View file

@ -94,15 +94,11 @@ defmodule Farside do
end
def save_results(file, data) do
case System.get_env("MIX_ENV") do
"prod" ->
nil
_ ->
{:ok, file} = File.open(file, [:append])
bin = :erlang.term_to_binary(data)
IO.binwrite(file, bin)
File.close(file)
if System.get_env("MIX_ENV") == "dev" do
{:ok, file} = File.open(file, [:append])
bin = :erlang.term_to_binary(data)
IO.binwrite(file, bin)
File.close(file)
end
end