mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-29 06:08:15 +02:00
Add receive bandwidth
This commit is contained in:
parent
ef69bf9256
commit
a57d32d05d
4 changed files with 77 additions and 6 deletions
|
@ -30,12 +30,13 @@ export const receiveBandwidth = async (
|
|||
const { publicKey, bytesIn, bytesOut } = peer;
|
||||
|
||||
// Find the site by public key
|
||||
const site = await trx.query.sites.findFirst({
|
||||
where: eq(sites.pubKey, publicKey)
|
||||
});
|
||||
const [site] = await trx
|
||||
.select()
|
||||
.from(sites)
|
||||
.where(eq(sites.pubKey, publicKey))
|
||||
.limit(1);
|
||||
|
||||
if (!site) {
|
||||
logger.warn(`Site not found for public key: ${publicKey}`);
|
||||
continue;
|
||||
}
|
||||
let online = site.online;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue