mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-04-12 13:49:33 +02:00
add simple self-hosted analytics
catch relay connection errors
This commit is contained in:
parent
f39ec04c24
commit
b1d11c40cc
@ -19,6 +19,13 @@
|
||||
property="og:image"
|
||||
content="https://repository-images.githubusercontent.com/581644549/d5eec580-ba3d-41e8-87db-58c313bf3f45"
|
||||
/>
|
||||
|
||||
<script
|
||||
async
|
||||
src="https://ackee.nostrudel.ninja/tracker.js"
|
||||
data-ackee-server="https://ackee.nostrudel.ninja"
|
||||
data-ackee-domain-id="58b1c39f-43f9-422b-bc7d-06aff35e764e"
|
||||
></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
@ -25,7 +25,12 @@ export class RelayPoolService {
|
||||
|
||||
const relay = this.relays.get(url) as Relay;
|
||||
if (connect && !relay.okay) {
|
||||
relay.open();
|
||||
try {
|
||||
relay.open();
|
||||
} catch (e) {
|
||||
console.log(`Failed to connect to ${relay.url}`);
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
return relay;
|
||||
}
|
||||
@ -42,7 +47,12 @@ export class RelayPoolService {
|
||||
for (const [url, relay] of this.relays.entries()) {
|
||||
const claims = this.getRelayClaims(url).size;
|
||||
if (!relay.okay && claims > 0) {
|
||||
relay.open();
|
||||
try {
|
||||
relay.open();
|
||||
} catch (e) {
|
||||
console.log(`Failed to connect to ${relay.url}`);
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user