Sha256: 8e63622721600f04a73b131d34fc7bbe09e0ee5088f87d667fe9217a0360a04a
Contents?: true
Size: 880 Bytes
Versions: 24
Compression:
Stored size: 880 Bytes
Contents
# frozen_string_literal: true module Thredded class ActivityUpdaterJob < ::ActiveJob::Base queue_as :default def perform(user_id, messageboard_id) now = Time.current begin user_detail = Thredded::UserDetail.find_or_initialize_by(user_id: user_id) user_detail.update!(last_seen_at: now) rescue ActiveRecord::RecordNotUnique # The record has been created from another connection, retry to find it. retry end begin Thredded::MessageboardUser .find_or_initialize_by( thredded_messageboard_id: messageboard_id, thredded_user_detail_id: user_detail.id ) .update!(last_seen_at: now) rescue ActiveRecord::RecordNotUnique # The record has been created from another connection, retry to find it. retry end end end end
Version data entries
24 entries across 24 versions & 1 rubygems