server: cleanup synchronous patterns

Bug: #340
This commit is contained in:
Jesse Chan
2021-06-26 14:52:10 +08:00
parent dafe0365e7
commit 7fa7eb5feb
9 changed files with 195 additions and 145 deletions
@@ -263,8 +263,7 @@ class ClientRequestManager {
if ((host === 'localhost' || host === '127.0.0.1' || host === '::1') && password === '') {
try {
actualPassword =
fs
.readFileSync(path.join(os.homedir(), '.config/deluge/auth'))
(await fs.promises.readFile(path.join(os.homedir(), '.config/deluge/auth')))
.toString('utf-8')
.split(os.EOL)
.find((entry) => entry.split(':')[0] === username)