Se agrega verificacion del tiempo de registro de mails
This commit is contained in:
parent
0166626299
commit
6b9c66c385
@ -141,6 +141,8 @@ defmodule Api.EmailToSendContext do
|
||||
end
|
||||
|
||||
def get_next_email() do
|
||||
one_day_ago = NaiveDateTime.utc_now() |> NaiveDateTime.add(-86400, :second)
|
||||
|
||||
from(
|
||||
e in Emailtosend,
|
||||
join: s in "study", on: s.idstudy == e.idstudy,
|
||||
@ -159,7 +161,8 @@ defmodule Api.EmailToSendContext do
|
||||
e.hasreport == true and
|
||||
e.sent != true and
|
||||
e.retries < 10
|
||||
),
|
||||
)
|
||||
and e.registered >= ^one_day_ago,
|
||||
limit: 1,
|
||||
select: %{
|
||||
idemailtosend: e.idemailtosend,
|
||||
|
Loading…
x
Reference in New Issue
Block a user