Skip to content

Commit 1230ee5

Browse files
committed
Avoid unnecessary stat
1 parent 4a03dc5 commit 1230ee5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/storage.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,11 +507,9 @@ export class Storage {
507507
*/
508508
public async migrateSessionToken(label: string) {
509509
const oldTokenPath = this.getLegacySessionTokenPath(label)
510+
const newTokenPath = this.getSessionTokenPath(label)
510511
try {
511-
await fs.stat(oldTokenPath)
512-
const newTokenPath = this.getSessionTokenPath(label)
513512
await fs.rename(oldTokenPath, newTokenPath)
514-
return
515513
} catch (error) {
516514
if ((error as NodeJS.ErrnoException)?.code === "ENOENT") {
517515
return

0 commit comments

Comments
 (0)