fix share list including expired shares
This commit is contained in:
@@ -30,6 +30,7 @@ impl Sqlite {
|
|||||||
pub async fn new(config: SqliteConfig) -> anyhow::Result<Self> {
|
pub async fn new(config: SqliteConfig) -> anyhow::Result<Self> {
|
||||||
let opts = SqliteConnectOptions::from_str(&config.database_url)?
|
let opts = SqliteConnectOptions::from_str(&config.database_url)?
|
||||||
.create_if_missing(true)
|
.create_if_missing(true)
|
||||||
|
.read_only(false)
|
||||||
.disable_statement_logging();
|
.disable_statement_logging();
|
||||||
|
|
||||||
let pool = SqlitePoolOptions::new().connect_with(opts).await?;
|
let pool = SqlitePoolOptions::new().connect_with(opts).await?;
|
||||||
|
|||||||
@@ -107,7 +107,8 @@ pub(super) async fn list_shares(
|
|||||||
shares
|
shares
|
||||||
WHERE
|
WHERE
|
||||||
warren_id = $1 AND
|
warren_id = $1 AND
|
||||||
path = $2
|
path = $2 AND
|
||||||
|
(expires_at IS NULL OR expires_at > CURRENT_TIMESTAMP)
|
||||||
ORDER BY
|
ORDER BY
|
||||||
created_at DESC
|
created_at DESC
|
||||||
",
|
",
|
||||||
|
|||||||
Reference in New Issue
Block a user