diff options
| author | Ivar Refsdal <ivar.refsdal@nsd.no> | 2021-09-17 14:25:08 +0200 |
|---|---|---|
| committer | Ivar Refsdal <ivar.refsdal@nsd.no> | 2021-09-17 14:25:08 +0200 |
| commit | ad8a41bd7d9e6fed77f633a75ef36410b7afbef1 (patch) | |
| tree | 6ddc2760f1bb6ab3abd88cfef428a161b28da875 /src/com/github/ivarref/yoltq.clj | |
| parent | Save bindings on put (diff) | |
| download | fiinha-ad8a41bd7d9e6fed77f633a75ef36410b7afbef1.tar.gz fiinha-ad8a41bd7d9e6fed77f633a75ef36410b7afbef1.tar.xz | |
Start add bindings ...
Diffstat (limited to 'src/com/github/ivarref/yoltq.clj')
| -rw-r--r-- | src/com/github/ivarref/yoltq.clj | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/com/github/ivarref/yoltq.clj b/src/com/github/ivarref/yoltq.clj index d3eefef..6341e41 100644 --- a/src/com/github/ivarref/yoltq.clj +++ b/src/com/github/ivarref/yoltq.clj @@ -58,6 +58,8 @@ ; contain the stacktrace of the stuck threads. :pool-size 4 + :capture-bindings [] + ; How often should the system be polled for failed queue jobs :system-error-poll-delay (Duration/ofMinutes 1) @@ -159,17 +161,17 @@ (d/create-database uri) (let [ok-items (atom []) conn (d/connect uri) - n 100] + n 1] (init! {:conn conn :error-backoff-time (Duration/ofSeconds 1) :poll-delay (Duration/ofSeconds 1)}) (add-consumer! :q (fn [payload] - (when (> (Math/random) 0.5) - (throw (ex-info "oops" {}))) + #_(when (> (Math/random) 0.5) + (throw (ex-info "oops" {}))) (if (= n (count (swap! received conj (:work payload)))) (log/info "... and we are done!") (log/info "got payload" payload "total ok:" (count @received))))) (start!) (dotimes [x n] - @(d/transact conn [(put :q {:work x})])) + @(d/transact conn [(put :q {:work 123})])) nil))))
\ No newline at end of file |
