You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# //
# -- Veil Configuration Don't remove this line
config :veil,
site_name: "makeawesomeworkshop",
email_from_name: "David Langford",
email_from_address: "davidlangford@hey.com",
sign_in_link_expiry: 12 * 3_600, # How long should emailed sign-in links be valid for?
session_expiry: 86_400 * 30, # How long should sessions be valid for?
refresh_expiry_interval: 86_400, # How often should existing sessions be extended to session_expiry
sessions_cache_limit: 250, # How many recent sessions to keep in cache (to reduce database operations)
users_cache_limit: 100 # How many recent users to keep in cache
config :veil, Veil.Scheduler,
jobs: [
# Runs every midnight to delete all expired requests and sessions
{"@daily", {Maw.Veil.Clean, :expired, []}}
]
# This is in dev.config and prod.secrect.config ~ David
# config :veil, MawWeb.Veil.Mailer,
# adapter: Swoosh.Adapters.Sendgrid,
# api_key: "your-api-key"
# -- End Veil Configuration
If I comment out this line in session_controller.ex the CPU will not spike
# session_controller.ex file
def create(conn, %{"request_id" => request_unique_id}) do
# --
# Commenting out the below line STOPS the CPU spiking
Task.start(fn -> Veil.verify_user(user_id) end)
# --
@That-David-Guy If you check on verify_user function, the return value from Cachex wasn't correct.
defverify_user(user_id)docaseget_user(user_id)do{:ok,user}-># <-- change user to {:ok, user} it will fix the issue with verifying user and resolve the process trap error.verify_user(user)error->errorendend
Hi
Locally, the following happens:
dev/mailbox
I was expecting my CPU not to jump at all.
No other action on my site seems to cause a CPU spike.
I'm not even sure how to go about debugging this? Do you have any ideas?
I'm following this blog post https://elixircasts.io/passwordless-authentication-with-veil .
My
config.exs
file:My
config/dev.exs
fileMy
mix.exs
file:The text was updated successfully, but these errors were encountered: