mirror of
https://github.com/fly-apps/live_beats.git
synced 2024-11-22 08:01:00 +00:00
Add more aggressive expiration and tell user about it
This commit is contained in:
parent
9f5abd842a
commit
ef4097c0a3
5 changed files with 8 additions and 5 deletions
2
fly.toml
2
fly.toml
|
@ -39,7 +39,7 @@ processes = []
|
||||||
port = 443
|
port = 443
|
||||||
|
|
||||||
[[services.tcp_checks]]
|
[[services.tcp_checks]]
|
||||||
grace_period = "10s" # allow some time for startup
|
grace_period = "20s" # allow some time for startup
|
||||||
interval = "15s"
|
interval = "15s"
|
||||||
restart_limit = 0
|
restart_limit = 0
|
||||||
timeout = "2s"
|
timeout = "2s"
|
|
@ -29,7 +29,8 @@ defmodule LiveBeats.Application do
|
||||||
name: PresenceClient},
|
name: PresenceClient},
|
||||||
# Start the Endpoint (http/https)
|
# Start the Endpoint (http/https)
|
||||||
LiveBeatsWeb.Endpoint,
|
LiveBeatsWeb.Endpoint,
|
||||||
{LiveBeats.SongsCleaner, interval: {7, :day}}
|
# Expire songs every six hours
|
||||||
|
{LiveBeats.SongsCleaner, interval: {3600 * 6, :second}}
|
||||||
|
|
||||||
# Start a worker by calling: LiveBeats.Worker.start_link(arg)
|
# Start a worker by calling: LiveBeats.Worker.start_link(arg)
|
||||||
# {LiveBeats.Worker, arg}
|
# {LiveBeats.Worker, arg}
|
||||||
|
|
|
@ -6,7 +6,7 @@ defmodule LiveBeats.SongsCleaner do
|
||||||
|
|
||||||
alias LiveBeats.MediaLibrary
|
alias LiveBeats.MediaLibrary
|
||||||
|
|
||||||
@poll_interval :timer.minutes(60)
|
@poll_interval :timer.minutes(30)
|
||||||
|
|
||||||
def start_link(opts) do
|
def start_link(opts) do
|
||||||
GenServer.start_link(__MODULE__, opts, name: __MODULE__)
|
GenServer.start_link(__MODULE__, opts, name: __MODULE__)
|
||||||
|
|
|
@ -238,7 +238,7 @@ defmodule LiveBeatsWeb.ProfileLive do
|
||||||
defp apply_action(socket, :new, _params) do
|
defp apply_action(socket, :new, _params) do
|
||||||
if socket.assigns.owns_profile? do
|
if socket.assigns.owns_profile? do
|
||||||
socket
|
socket
|
||||||
|> assign(:page_title, "Add Songs")
|
|> assign(:page_title, "Add Music")
|
||||||
|> assign(:song, %MediaLibrary.Song{})
|
|> assign(:song, %MediaLibrary.Song{})
|
||||||
|> show_upload_modal()
|
|> show_upload_modal()
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<div>
|
<div>
|
||||||
<h2><%= @title %></h2>
|
<h2><%= @title %>
|
||||||
|
<p class="inline text-gray-500 text-sm ml-2">(songs expire every six hours)</p>
|
||||||
|
</h2>
|
||||||
|
|
||||||
<.form
|
<.form
|
||||||
for={:songs}
|
for={:songs}
|
||||||
|
|
Loading…
Reference in a new issue