cleanup main logging

This commit is contained in:
Bruno Windels 2019-02-07 00:50:47 +00:00
parent 3438806781
commit 90b016bbcf

View file

@ -38,14 +38,16 @@ async function main() {
({sessionId, loginData} = await login(USERNAME, PASSWORD, HOMESERVER)); ({sessionId, loginData} = await login(USERNAME, PASSWORD, HOMESERVER));
} }
const storage = await createIdbStorage(`morpheus_session_${sessionId}`); const storage = await createIdbStorage(`morpheus_session_${sessionId}`);
console.log("database created", storage);
const session = new Session(storage); const session = new Session(storage);
if (loginData) { if (loginData) {
await session.setLoginData(loginData); await session.setLoginData(loginData);
} }
await session.load(); await session.load();
const hsApi = new HomeServerApi(HOMESERVER, session.accessToken); const hsApi = new HomeServerApi(HOMESERVER, session.accessToken);
console.log("session loaded", session, hsApi); console.log("session loaded");
if (!session.syncToken) {
console.log("session needs initial sync");
}
return; return;
const sync = new Sync(hsApi, session, storage); const sync = new Sync(hsApi, session, storage);
await sync.start(); await sync.start();