Migrate to private class properties/methods

This commit is contained in:
Jamie Kyle 2025-01-14 11:11:52 -08:00 committed by GitHub
parent 7dbe57084b
commit aa9f53df57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
100 changed files with 3795 additions and 3944 deletions

View file

@ -26,8 +26,8 @@ const MIN_REFRESH_DELAY = MINUTE;
let idCounter = 1;
export class RoutineProfileRefresher {
private started = false;
private id: number;
#started = false;
#id: number;
constructor(
private readonly options: {
@ -39,20 +39,20 @@ export class RoutineProfileRefresher {
// We keep track of how many of these classes we create, because we suspect that
// there might be too many...
idCounter += 1;
this.id = idCounter;
this.#id = idCounter;
log.info(
`Creating new RoutineProfileRefresher instance with id ${this.id}`
`Creating new RoutineProfileRefresher instance with id ${this.#id}`
);
}
public async start(): Promise<void> {
const logId = `RoutineProfileRefresher.start/${this.id}`;
const logId = `RoutineProfileRefresher.start/${this.#id}`;
if (this.started) {
if (this.#started) {
log.warn(`${logId}: already started!`);
return;
}
this.started = true;
this.#started = true;
const { storage, getAllConversations, getOurConversationId } = this.options;
@ -81,7 +81,7 @@ export class RoutineProfileRefresher {
allConversations: getAllConversations(),
ourConversationId,
storage,
id: this.id,
id: this.#id,
});
} catch (error) {
log.error(`${logId}: failure`, Errors.toLogFormat(error));