summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2011-03-05 21:24:39 +0100
committerJochen Topf <jochen@topf.org>2011-03-05 21:24:39 +0100
commit285df77f092451e3bfcbfcdefa484fe4affcee2e (patch)
tree74ceca50352e6e8ab60f3e075e39677d6a0fd1fb
parentf4ea631ae8a5c14650a9eb05b8cc1d3223b4e985 (diff)
downloadtaginfo-285df77f092451e3bfcbfcdefa484fe4affcee2e.tar
taginfo-285df77f092451e3bfcbfcdefa484fe4affcee2e.tar.gz
only to data_until query once at program startup
-rwxr-xr-xweb/taginfo.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/web/taginfo.rb b/web/taginfo.rb
index 951c4ed..a1040ff 100755
--- a/web/taginfo.rb
+++ b/web/taginfo.rb
@@ -53,6 +53,8 @@ db.select('SELECT * FROM sources ORDER BY no').execute().each do |source|
Source.new source['id'], source['name'], source['data_until'], source['update_start'], source['update_end'], source['visible'] == '1'
end
+DATA_UNTIL = db.select("SELECT min(data_until) FROM sources").get_first_value().sub(/:..$/, '')
+
db.close
class Taginfo < Sinatra::Base
@@ -102,7 +104,7 @@ class Taginfo < Sinatra::Base
@db = SQL::Database.new('../../data')
- @data_until = @db.select("SELECT min(data_until) FROM sources").get_first_value().sub(/:..$/, '')
+ @data_until = DATA_UNTIL
@breadcrumbs = []
end