(methodical/defmethod events/publish-event! ::event
[topic {database :object :as _event}]
;; try/catch here to prevent individual topic processing exceptions from bubbling up. better to handle them here.
(try
(when database
;; just kick off a sync on another thread
(future
(try
;; only do the 'full' sync if this is a "full sync" database. Otherwise just do metadata sync only
(if (:is_full_sync database)
(sync/sync-database! database)
(sync-metadata/sync-db-metadata! database))
(catch Throwable e
(log/errorf e "Error syncing Database %s" (u/the-id database))))))
(catch Throwable e
(log/warnf e "Failed to process sync-database event: %s" topic)))) |