This commit is contained in:
Louis Lam
2024-09-28 01:22:45 +08:00
parent 7046a2e0f6
commit 67ad0f79b3
2 changed files with 37 additions and 7 deletions

View File

@@ -189,11 +189,14 @@ class UptimeCalculator {
/**
* @param {number} status status
* @param {number} ping Ping
* @param {dayjs.Dayjs} date Date (Only for migration)
* @returns {dayjs.Dayjs} date
* @throws {Error} Invalid status
*/
async update(status, ping = 0) {
let date = this.getCurrentDate();
async update(status, ping = 0, date) {
if (!date) {
date = this.getCurrentDate();
}
let flatStatus = this.flatStatus(status);