Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Lun4m committed Jun 11, 2024
1 parent dc57179 commit 905fa90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/src/timeseries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ pub async fn get_timeseries_data_regular(
"P1D" => "1 day",
_ => "1 minute", // FIXME: this should error instead of falling back to a default
};

// TODO: this generates nulls till utc.now if end_time is not specified in the database?
let query_string = format!("SELECT data.obsvalue, ts_rule.timestamp \
FROM (SELECT data.obsvalue, data.obstime FROM data WHERE data.timeseries = $1) as data
RIGHT JOIN generate_series($2::timestamptz, $3::timestamptz, interval '{}') AS ts_rule(timestamp) \
Expand Down
2 changes: 2 additions & 0 deletions ingestion/src/kldata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ pub async fn filter_and_label_kldata(
Some(row) => row.get(0),
None => {
// create new timeseries
// TODO: we insert a new timeseries with NULL location?
// Should we query for the station info?
let timeseries_id = transaction
.query_one(
"INSERT INTO public.timeseries (fromtime) VALUES ($1) RETURNING id",
Expand Down

0 comments on commit 905fa90

Please sign in to comment.