Skip to content

Commit 0d53020

Browse files
committed
dev: fix a timestamp bug in old name expiry
1 parent 6d2966f commit 0d53020

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/backend/src/services/OldAppNameService.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,20 @@ class OldAppNameService extends BaseService {
2929

3030
// Check if the app has been renamed in the last N months
3131
const [row] = rows;
32-
const timestamp = new Date(row.timestamp);
32+
const timestamp = new Date(
33+
// Ensure timestamp ir processed as UTC
34+
row.timestamp.endsWith('Z') ? row.timestamp : row.timestamp + 'Z'
35+
);
3336

3437
const age = Date.now() - timestamp.getTime();
3538

36-
const n_ms = N_MONTHS * 30 * 24 * 60 * 60 * 1000
39+
const n_ms = 60 * 1000;
40+
// const n_ms = N_MONTHS * 30 * 24 * 60 * 60 * 1000
41+
this.log.noticeme('AGE INFO', {
42+
input_time: row.timestamp,
43+
age,
44+
n_ms,
45+
});
3746
if ( age > n_ms ) {
3847
// Remove record
3948
await this.db.write(

0 commit comments

Comments
 (0)