const getAppBranchInfo = (appId, branch) => new Promise(resolve => {
let user = new SteamUser();
user.on('loggedOn', async () => {
const productInfo = await user.getProductInfo([appId], []);
const appName = productInfo.apps[appId].appinfo.common.name;
const buildId = productInfo.apps[appId].appinfo.depots.branches[branch].buildid;
const timeUpdated = productInfo.apps[appId].appinfo.depots.branches[branch].timeupdated;
// Graefully logoff.
user.logOff();
resolve({
appName: appName,
buildId: buildId,
timeUpdated: timeUpdated
});
});
user.logOn();
});
const job = schedule.scheduleJob('*/3 * * * * *', () => {
console.log(formatDate());
getAppBranchInfo(740, 'public')
.then(info => {
// [...]
});
});
This ran for several hours before:
Feb 7 @ 05:37:21 (UTC)
/Users/user/git/app/node_modules/steam-user/components/logon.js:23
throw new Error("Already logged on, cannot log on again");
^
Error: Already logged on, cannot log on again
at /Users/user/git/app/node_modules/steam-user/components/logon.js:23:10
The only thing I can think of is that attempting to login anonymously every 3 seconds is too often, but surely it's not possible to already be logged in?