Skip to content
Snippets Groups Projects
Commit 63929d6a authored by Allen Gilliland's avatar Allen Gilliland
Browse files

be consistent about using :custom_id instead of :tracking-hash or other ways...

be consistent about using :custom_id instead of :tracking-hash or other ways of specifying an activity custom identifier.
parent fda305f7
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,7 @@
(let [start-time (System/currentTimeMillis)
tracking-hash (str (java.util.UUID/randomUUID))]
(log/info (u/format-color 'magenta "Syncing %s database '%s'..." (name (:engine database)) (:name database)))
(events/publish-event :database-sync-begin {:database_id (:id database) :tracking-hash tracking-hash})
(events/publish-event :database-sync-begin {:database_id (:id database) :custom_id tracking-hash})
(let [active-table-names (active-table-names driver database)
table-name->id (sel :many :field->id [Table :name] :db_id (:id database) :active true)]
......@@ -79,7 +79,7 @@
(map #(assoc % :db (delay database))) ; replace default delays with ones that reuse database (and don't require a DB call)
(sync-database-active-tables! driver))
(events/publish-event :database-sync-end {:database_id (:id database) :tracking-hash tracking-hash :running_time (- (System/currentTimeMillis) start-time)})
(events/publish-event :database-sync-end {:database_id (:id database) :custom_id tracking-hash :running_time (- (System/currentTimeMillis) start-time)})
(log/info (u/format-color 'magenta "Finished syncing %s database %s. (%d ms)" (name (:engine database)) (:name database)
(- (System/currentTimeMillis) start-time))))))))
......
......@@ -111,15 +111,15 @@
:topic :database-sync
:model (topic->model topic)
:model_id (object->model-id topic object)
:custom_id (:tracking-hash object)
:custom_id (:custom_id object)
:details (-> object
(assoc :status "started")
(dissoc :database_id :tracking-hash)))
:database-sync-end (let [{activity-id :id} (sel :one Activity :custom_id (:tracking-hash object))]
(dissoc :database_id :custom_id)))
:database-sync-end (let [{activity-id :id} (sel :one Activity :custom_id (:custom_id object))]
(upd Activity activity-id
:details (-> object
(assoc :status "completed")
(dissoc :database_id :tracking-hash))))))
(dissoc :database_id :custom_id))))))
(defn- process-user-activity [topic object]
;; we only care about login activity when its the users first session (a.k.a. new user!)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment