Migrate to private class properties/methods
This commit is contained in:
@@ -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));
|
||||
|
Reference in New Issue
Block a user