Skip to content

Commit

Permalink
Merge pull request #105 from RunOnFlux/separateProcessing
Browse files Browse the repository at this point in the history
Separate processing
  • Loading branch information
TheTrunk authored Aug 12, 2024
2 parents 028273e + 089ae3a commit 51a59e7
Show file tree
Hide file tree
Showing 2 changed files with 419 additions and 323 deletions.
11 changes: 10 additions & 1 deletion src/services/application/checks.js
Original file line number Diff line number Diff line change
Expand Up @@ -729,9 +729,18 @@ async function checkBittensor(ip, port) {

async function checkAppRunning(url, appName) {
try {
const { CancelToken } = axios;
const source = CancelToken.source();
let isResolved = false;
setTimeout(() => {
if (!isResolved) {
source.cancel('Operation canceled by the user.');
}
}, timeout * 2);

const ip = url.split(':')[0];
const port = url.split(':')[1] || 16127;
const response = await axios.get(`http://${ip}:${port}/apps/listrunningapps`);
const response = await axios.get(`http://${ip}:${port}/apps/listrunningapps`, { timeout, cancelToken: source.token });
const appsRunning = response.data.data;
if (appsRunning.find((app) => app.Names[0].includes(appName))) {
return true;
Expand Down
Loading

0 comments on commit 51a59e7

Please sign in to comment.