Jump to content
McKay Development

Sharing the same steamcommunity across multiple workers


Recommended Posts

I have this code so far

origin.js
const SteamCommunity = require("steamcommunity");
const origin = new SteamCommunity();
module.exports = { origin };
__________________________________________________________________________________________________

index.js
const { origin } = require("./origin.js");

origin.login({ accountName: originuser, password: originpass, authCode: "", twoFactorCode: "", captcha: "" }, function (err) {
  if (!err) {
    console.log("logged into origin");
  }
  // call worker
});

__________________________________________________________________________________________________

worker.js
const { origin } = require("./origin.js");
const { workerData } = require("worker_threads");

origin.editProfile({ customURL: workerData }, function (err) {
  if (!err) {
    console.log("changed url on origin");
});

Yet I get an error in worker.js saying I'm not logged in, I assume this is because it is creating a new steamcommunity every time require("./origin.js") is called, so how can I share the same steamcommunity across multiple workers, so I don't have to login inside each worker?

Edited by Tayhayy
Link to comment
Share on other sites

  • Tayhayy changed the title to Sharing the same steamcommunity across multiple workers

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...