mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-02 23:28:39 +08:00
dev: fix a timestamp bug in old name expiry
This commit is contained in:
parent
6d2966f314
commit
0d53020739
@ -29,11 +29,20 @@ class OldAppNameService extends BaseService {
|
|||||||
|
|
||||||
// Check if the app has been renamed in the last N months
|
// Check if the app has been renamed in the last N months
|
||||||
const [row] = rows;
|
const [row] = rows;
|
||||||
const timestamp = new Date(row.timestamp);
|
const timestamp = new Date(
|
||||||
|
// Ensure timestamp ir processed as UTC
|
||||||
|
row.timestamp.endsWith('Z') ? row.timestamp : row.timestamp + 'Z'
|
||||||
|
);
|
||||||
|
|
||||||
const age = Date.now() - timestamp.getTime();
|
const age = Date.now() - timestamp.getTime();
|
||||||
|
|
||||||
const n_ms = N_MONTHS * 30 * 24 * 60 * 60 * 1000
|
const n_ms = 60 * 1000;
|
||||||
|
// const n_ms = N_MONTHS * 30 * 24 * 60 * 60 * 1000
|
||||||
|
this.log.noticeme('AGE INFO', {
|
||||||
|
input_time: row.timestamp,
|
||||||
|
age,
|
||||||
|
n_ms,
|
||||||
|
});
|
||||||
if ( age > n_ms ) {
|
if ( age > n_ms ) {
|
||||||
// Remove record
|
// Remove record
|
||||||
await this.db.write(
|
await this.db.write(
|
||||||
|
Loading…
Reference in New Issue
Block a user