Skip to content

change !indexes from {} to nil #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions profiles/dev/user.clj
Original file line number Diff line number Diff line change
@@ -36,3 +36,11 @@
[:message-page :cache-time]
(constantly new-cache-time))
true)

(comment
(go)
(reset)
(reset-all)
(use 'clojurians-log.repl)
(load-demo-data! "../clojurians-log-demo-data")
#_:end)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this #_:end for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I remove this admittedly confusing #:end)?
In my defence: Moving the closing bracket to the next line makes evaluating of the (load-demo-data ...) much easier, as I just move to eol with $ before before pressing ,ee. The #
:end is just so that the bracket is not alone, sorry for having to bear with my sentimentality :-), should have cleaned this before committing, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took it out. It's not problematic as such, but it might confuse people.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this elegant solution.

4 changes: 2 additions & 2 deletions src/clojurians_log/db/queries.clj
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
(:require [clojurians-log.datomic :as d]
[clojurians-log.time-util :as time-util]))

(defonce !indexes (atom {}))
(defonce !indexes (atom nil))

(defn channels-dates-msgcounts [db]
(d/q '[:find ?slack-id ?chan-name ?day (count ?msg)
@@ -23,7 +23,7 @@
(assoc-in [:day-chan-cnt day slack-id] msgcount)
(assoc-in [:chan-id->name slack-id] chan-name)
(assoc-in [:chan-name->id chan-name] slack-id)))
{}
nil
cdm)))

(defn build-indexes! [db]