Change graph periods

This commit is contained in:
jude 2023-06-21 15:36:05 +01:00
parent 284bfcd9ad
commit 6de11f09db
3 changed files with 6 additions and 6 deletions

2
Cargo.lock generated
View File

@ -2217,7 +2217,7 @@ checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78"
[[package]] [[package]]
name = "reminder-rs" name = "reminder-rs"
version = "1.6.17" version = "1.6.17-1"
dependencies = [ dependencies = [
"base64 0.21.2", "base64 0.21.2",
"chrono", "chrono",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "reminder-rs" name = "reminder-rs"
version = "1.6.17" version = "1.6.17-1"
authors = ["Jude Southworth <judesouthworth@pm.me>"] authors = ["Jude Southworth <judesouthworth@pm.me>"]
edition = "2021" edition = "2021"
license = "AGPL-3.0 only" license = "AGPL-3.0 only"

View File

@ -54,7 +54,7 @@ pub async fn bot_data(cookies: &CookieJar<'_>, pool: &State<Pool<MySql>>) -> Jso
let schedule_once = sqlx::query_as_unchecked!( let schedule_once = sqlx::query_as_unchecked!(
TimeFrame, TimeFrame,
"SELECT "SELECT
FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(`utc_time`) / 600) * 600) AS `time_key`, FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(`utc_time`) / 300) * 300) AS `time_key`,
COUNT(1) AS `count` COUNT(1) AS `count`
FROM reminders FROM reminders
WHERE WHERE
@ -74,7 +74,7 @@ pub async fn bot_data(cookies: &CookieJar<'_>, pool: &State<Pool<MySql>>) -> Jso
let schedule_interval = sqlx::query_as_unchecked!( let schedule_interval = sqlx::query_as_unchecked!(
TimeFrame, TimeFrame,
"SELECT "SELECT
FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(`utc_time`) / 600) * 600) AS `time_key`, FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(`utc_time`) / 300) * 300) AS `time_key`,
COUNT(1) AS `count` COUNT(1) AS `count`
FROM reminders FROM reminders
WHERE WHERE
@ -99,7 +99,7 @@ pub async fn bot_data(cookies: &CookieJar<'_>, pool: &State<Pool<MySql>>) -> Jso
COUNT(1) AS `count` COUNT(1) AS `count`
FROM reminders FROM reminders
WHERE WHERE
`utc_time` < DATE_ADD(NOW(), INTERVAL 14 DAY) AND `utc_time` < DATE_ADD(NOW(), INTERVAL 31 DAY) AND
`utc_time` >= NOW() AND `utc_time` >= NOW() AND
`enabled` = 1 AND `enabled` = 1 AND
`interval_seconds` IS NULL AND `interval_seconds` IS NULL AND
@ -119,7 +119,7 @@ pub async fn bot_data(cookies: &CookieJar<'_>, pool: &State<Pool<MySql>>) -> Jso
COUNT(1) AS `count` COUNT(1) AS `count`
FROM reminders FROM reminders
WHERE WHERE
`utc_time` < DATE_ADD(NOW(), INTERVAL 14 DAY) AND `utc_time` < DATE_ADD(NOW(), INTERVAL 31 DAY) AND
`utc_time` >= NOW() AND `utc_time` >= NOW() AND
`enabled` = 1 AND ( `enabled` = 1 AND (
`interval_seconds` IS NOT NULL OR `interval_seconds` IS NOT NULL OR