Skip to content

Commit

Permalink
rm hardcoded num
Browse files Browse the repository at this point in the history
  • Loading branch information
terrywbrady committed May 1, 2024
1 parent fc479c2 commit d515744
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src-admintool/queries/ingest_by_month_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class IngestBytesByMonthQuery < AdminQuery
def initialize(query_factory, path, myparams)
super(query_factory, path, myparams)
@defyears = 10
@totit = @defyears * 12 + 1
@tend = ((Date.today - Date.today.day + 1) >> 1).strftime('%Y-%m-%d')
@tstart = ((Date.today - Date.today.day + 1) << (12 * @defyears)).strftime('%Y-%m-%d')
end
Expand All @@ -21,7 +22,7 @@ def get_sql
from
(
}
121.times do |y|
@totit.times do |y|
sql += %( union ) unless y.zero?
sql += %{
select date_add(date('#{@tstart}'), interval #{y} MONTH) as ts
Expand Down

0 comments on commit d515744

Please sign in to comment.