aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancis Irving <francis@mysociety.org>2010-05-25 00:54:19 +0100
committerFrancis Irving <francis@mysociety.org>2010-05-25 00:54:19 +0100
commitece0fb10db9f7c259efc62a27fb53330cb514e5e (patch)
treede69ccc26dad29a972ed2209c62f2b6ece39d530
parent7572c232bf59e9700c526bfbba7d5ef262a07f63 (diff)
Comment on inefficiency
-rw-r--r--app/models/track_mailer.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/track_mailer.rb b/app/models/track_mailer.rb
index 53a7ec81d..f5ca38c2e 100644
--- a/app/models/track_mailer.rb
+++ b/app/models/track_mailer.rb
@@ -41,6 +41,9 @@ class TrackMailer < ApplicationMailer
# STDERR.puts Time.now.to_s + " track " + track_thing.track_query
# What have we alerted on already?
+ # XXX this is pretty inefficient, should be restricting amount of objects returned
+ # with track_things_sent_emails by a date range. Or, better, deleting old entries
+ # from the database entirely.
done_info_request_events = {}
for t in track_thing.track_things_sent_emails
if not t.info_request_event_id.nil?
@@ -52,7 +55,6 @@ class TrackMailer < ApplicationMailer
# ordering, so we catch anything new (before described), or
# anything whose new status has been described.
xapian_object = InfoRequest.full_search([InfoRequestEvent], track_thing.track_query, 'described_at', true, nil, 200, 1)
-
# Go through looking for unalerted things
alert_results = []
for result in xapian_object.results