mirror of
https://github.com/imputnet/cobalt.git
synced 2024-12-28 18:46:09 +00:00
api/cookies: log message to confirm successful file load
This commit is contained in:
parent
5a5a65b373
commit
b434b0b45e
|
@ -1,6 +1,7 @@
|
|||
import Cookie from './cookie.js';
|
||||
import { readFile, writeFile } from 'fs/promises';
|
||||
import { parse as parseSetCookie, splitCookiesString } from 'set-cookie-parser';
|
||||
import { Green, Yellow } from '../../misc/console-text.js';
|
||||
|
||||
const WRITE_INTERVAL = 60000,
|
||||
COUNTER = Symbol('counter');
|
||||
|
@ -12,7 +13,11 @@ export const setup = async (cookiePath) => {
|
|||
cookies = await readFile(cookiePath, 'utf8');
|
||||
cookies = JSON.parse(cookies);
|
||||
intervalId = setInterval(writeChanges, WRITE_INTERVAL);
|
||||
} catch { /* no cookies for you */ }
|
||||
console.log(`${Green('[✓]')} cookies loaded successfully!`)
|
||||
} catch(e) {
|
||||
console.error(`${Yellow('[!]')} failed to load cookies.`);
|
||||
console.error('error:', e);
|
||||
}
|
||||
}
|
||||
|
||||
function writeChanges() {
|
||||
|
|
Loading…
Reference in a new issue