Skip to content

Commit bb66ad2

Browse files
committed
Clean up, add otel tracing
1 parent b8e6460 commit bb66ad2

5 files changed

Lines changed: 255 additions & 242 deletions

File tree

OpenFlow/src/Auth.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,13 @@ export class Auth {
7272
this.RemoveUser(key, type);
7373
return null;
7474
}
75-
public static async clearCache() {
75+
public static async clearCache(reason: string) {
76+
Logger.instanse.verbose("clearCache " + reason);
7677
if (this.authorizationCache == null) return;
77-
const keys: string[] = Object.keys(this.authorizationCache);
78-
for (let i = keys.length - 1; i >= 0; i--) {
79-
let key: string = keys[i];
80-
var res: CachedUser = this.authorizationCache[key];
81-
if (res === null || res === undefined) continue;
82-
this.RemoveUser(key, res.type);
83-
}
78+
Auth.ensureotel();
79+
await Auth.semaphore.down();
80+
this.authorizationCache = {}
81+
Auth.semaphore.up();
8482
}
8583
public static async cleanCache() {
8684
try {

0 commit comments

Comments
 (0)