Skip to content

Commit

Permalink
Merge pull request #1433 from RunOnFlux/development
Browse files Browse the repository at this point in the history
v5.38.1
  • Loading branch information
TheTrunk authored Jan 30, 2025
2 parents 5399f22 + d05c34c commit 6a2547a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions ZelBack/src/services/appsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -3773,6 +3773,7 @@ async function registerAppLocally(appSpecs, componentSpecs, res, test = false) {
broadcastedAt,
runningSince: broadcastedAt,
osUptime: os.uptime(),
staticIp: geolocationService.isStaticIP(),
};

// store it in local database first
Expand Down Expand Up @@ -6636,6 +6637,8 @@ async function storeAppRunningMessage(message) {
ip: message.ip,
broadcastedAt: new Date(message.broadcastedAt),
expireAt: new Date(validTill),
osUptime: message.osUptime,
staticIp: message.staticIp,
};

// indexes over name, hash, ip. Then name + ip and name + ip + broadcastedAt.
Expand All @@ -6656,9 +6659,6 @@ async function storeAppRunningMessage(message) {
} else if (result && result.runningSince) {
newAppRunningMessage.runningSince = result.runningSince;
}
if (result.osUptime) {
newAppRunningMessage.osUptime = result.osUptime;
}
const queryUpdate = { name: newAppRunningMessage.name, ip: newAppRunningMessage.ip };
const update = { $set: newAppRunningMessage };
const options = {
Expand Down Expand Up @@ -8728,6 +8728,7 @@ async function appLocation(appname) {
expireAt: 1,
runningSince: 1,
osUptime: 1,
staticIp: 1,
},
};
const results = await dbHelper.findInDatabase(database, globalAppsLocations, query, projection);
Expand Down Expand Up @@ -8825,6 +8826,7 @@ async function getRunningAppIpList(ip) { // returns all apps running on this ip
expireAt: 1,
runningSince: 1,
osUptime: 1,
staticIp: 1,
},
};
const results = await dbHelper.findInDatabase(database, globalAppsLocations, query, projection);
Expand All @@ -8850,6 +8852,7 @@ async function getRunningAppList(appName) {
expireAt: 1,
runningSince: 1,
osUptime: 1,
staticIp: 1,
},
};
const results = await dbHelper.findInDatabase(database, globalAppsLocations, query, projection);
Expand Down Expand Up @@ -9637,6 +9640,7 @@ async function checkAndNotifyPeersOfRunningApps() {
broadcastedAt: Date.now(),
runningSince: runningOnMyNodeSince,
osUptime: os.uptime(),
staticIp: geolocationService.isStaticIP(),
};
const app = {
name: application.name,
Expand Down Expand Up @@ -9667,6 +9671,7 @@ async function checkAndNotifyPeersOfRunningApps() {
ip: myIP,
broadcastedAt: Date.now(),
osUptime: os.uptime(),
staticIp: geolocationService.isStaticIP(),
};
// eslint-disable-next-line no-await-in-loop
await fluxCommunicationMessagesSender.broadcastMessageToOutgoing(newAppRunningMessageV2);
Expand All @@ -9689,6 +9694,7 @@ async function checkAndNotifyPeersOfRunningApps() {
ip: myIP,
broadcastedAt: Date.now(),
osUptime: os.uptime(),
staticIp: geolocationService.isStaticIP(),
};
// eslint-disable-next-line no-await-in-loop
await fluxCommunicationMessagesSender.broadcastMessageToOutgoing(newAppRunningMessageV2);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flux",
"version": "5.38.0",
"version": "5.38.1",
"description": "Flux, Your Gateway to a Decentralized World",
"repository": {
"type": "git",
Expand Down

0 comments on commit 6a2547a

Please sign in to comment.