Don't use nanos
This commit is contained in:
parent
af0049aa5a
commit
79a648494d
|
@ -131,7 +131,7 @@ pub async fn store_file(
|
|||
// It'd be nice to use the UUID crate for the file ID, but clients want an integer ID
|
||||
const UPPER_BOUND: u64 = 2u64.pow(53); // JS has trouble if we go higher than this
|
||||
let id: u64 = thread_rng().gen_range(0..UPPER_BOUND);
|
||||
let now = chrono::Utc::now().timestamp_nanos();
|
||||
let now = chrono::Utc::now().timestamp();
|
||||
// Check authorization level if needed
|
||||
match rpc::MODE {
|
||||
rpc::Mode::OpenGroupServer => {
|
||||
|
|
|
@ -244,7 +244,7 @@ pub async fn prune_files(file_expiration: i64) {
|
|||
for room in rooms {
|
||||
// It's not catastrophic if we fail to prune the database for a given room
|
||||
let pool = pool_by_room_id(&room);
|
||||
let now = chrono::Utc::now().timestamp_nanos();
|
||||
let now = chrono::Utc::now().timestamp();
|
||||
let expiration = now - file_expiration;
|
||||
// Get a database connection and open a transaction
|
||||
let conn = match pool.get() {
|
||||
|
|
Loading…
Reference in New Issue