Browse Source

add file logging, improve scheduler config

master
Inhji Y. 2 years ago
parent
commit
42de89c1e7
  1. 4
      .gitignore
  2. 47
      config/config.exs
  3. 7
      mix.exs
  4. 1
      mix.lock

4
.gitignore

@ -33,4 +33,6 @@ npm-debug.log
# this depending on your deployment strategy.
/priv/static/
/uploads/
/uploads/
/log/

47
config/config.exs

@ -26,25 +26,48 @@ config :dagon, DagonWeb.Endpoint,
# Configures Quantum Scheduler
config :dagon, Dagon.Scheduler,
schedule: "* * * * *",
overlap: true,
jobs: [
{{:cron, "* * * * *"}, {Que, :add, [Dagon.Listens.Workers.Listenbrainz, %{user: "inhji"}]}},
{{:cron, "* * * * *"},
{Que, :add, [Dagon.Listens.Workers.ListenbrainzNow, %{user: "inhji"}]}},
{{:cron, "* * * * *"},
{Que, :add, [Dagon.Listens.Workers.Covertartarchive, %{user: "inhji"}]}},
{{:cron, "* * * * *"},
{Que, :add,
[Dagon.Listens.Workers.DiscogsAlbum, %{token: "kRIDCYTMRucJojWzQKlXlDAnDlQSgmXboMEZiUBT"}]}},
{{:cron, "* * * * *"},
{Que, :add,
[Dagon.Listens.Workers.DiscogsArtist, %{token: "kRIDCYTMRucJojWzQKlXlDAnDlQSgmXboMEZiUBT"}]}}
listenbrainz: [
schedule: {:extended, "*/30"},
task: {Que, :add, [Dagon.Listens.Workers.Listenbrainz, %{user: "inhji"}]}
],
listenbrainz_now: [
schedule: {:extended, "*/30"},
task: {Que, :add, [Dagon.Listens.Workers.ListenbrainzNow, %{user: "inhji"}]}
],
coverartarchive: [
task: {Que, :add, [Dagon.Listens.Workers.Covertartarchive, %{user: "inhji"}]}
],
discogs_album: [
task:
{Que, :add,
[
Dagon.Listens.Workers.DiscogsAlbum,
%{token: "kRIDCYTMRucJojWzQKlXlDAnDlQSgmXboMEZiUBT"}
]}
],
discogs_artist: [
task:
{Que, :add,
[
Dagon.Listens.Workers.DiscogsArtist,
%{token: "kRIDCYTMRucJojWzQKlXlDAnDlQSgmXboMEZiUBT"}
]}
]
]
# Configures Elixir's Logger
config :logger, :console,
config :logger,
backends: [:console, {LoggerFileBackend, :error_log}],
format: "$time $metadata[$level] $message\n",
metadata: [:request_id]
config :logger, :error_log,
path: "./log/debug.log",
level: :debug
# Use Jason for JSON parsing in Phoenix
config :phoenix, :json_library, Jason

7
mix.exs

@ -20,7 +20,11 @@ defmodule Dagon.MixProject do
def application do
[
mod: {Dagon.Application, []},
extra_applications: [:logger, :runtime_tools]
extra_applications: [
:logger,
:logger_file_backend,
:runtime_tools
]
]
end
@ -40,6 +44,7 @@ defmodule Dagon.MixProject do
{:gettext, "~> 0.11"},
{:httpoison, "~> 1.6"},
{:jason, "~> 1.0"},
{:logger_file_backend, "~> 0.0.11"},
{:phoenix, "~> 1.4.10"},
{:phoenix_ecto, "~> 4.0"},
{:phoenix_html, "~> 2.11"},

1
mix.lock

@ -27,6 +27,7 @@
"jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"},
"jumper": {:hex, :jumper, "1.0.1", "3c00542ef1a83532b72269fab9f0f0c82bf23a35e27d278bfd9ed0865cecabff", [:mix], [], "hexpm"},
"libring": {:hex, :libring, "1.4.0", "41246ba2f3fbc76b3971f6bce83119dfec1eee17e977a48d8a9cfaaf58c2a8d6", [:mix], [], "hexpm"},
"logger_file_backend": {:hex, :logger_file_backend, "0.0.11", "3bbc5f31d3669e8d09d7a9443e86056fae7fc18e45c6f748c33b8c79a7e147a1", [:mix], [], "hexpm"},
"memento": {:hex, :memento, "0.3.1", "b2909390820550d8b90b68ec96f9e15ff8a45a28b6f97fa4a62ef50e87c2f9d9", [:mix], [], "hexpm"},
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm"},
"mime": {:hex, :mime, "1.3.1", "30ce04ab3175b6ad0bdce0035cba77bba68b813d523d1aac73d9781b4d193cf8", [:mix], [], "hexpm"},

Loading…
Cancel
Save