mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
FEATURE: add a simple queue Scheduler::Defer.later {}
For quick jobs that do not need to be sent to sidekiq, runs inline in a single thread but does not block
This commit is contained in:
parent
fe63db7953
commit
2c8ae22b87
4 changed files with 95 additions and 3 deletions
|
@ -33,9 +33,12 @@ class Auth::DefaultCurrentUserProvider
|
|||
|
||||
if current_user
|
||||
|
||||
Jobs.enqueue(:update_user_info,
|
||||
user_id: current_user.id,
|
||||
ip: request.ip)
|
||||
u = current_user
|
||||
Scheduler::Defer.later do
|
||||
u.update_last_seen!
|
||||
u.update_ip_address!(request.ip)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# possible we have an api call, impersonate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue