This repository has been archived on 2026-03-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
cau-praktikum/app/static/js/presence.js
T

19 lines
409 B
JavaScript

(function startPresenceHeartbeat() {
const ping = function () {
fetch("/api/presence/ping", {
method: "POST",
credentials: "same-origin",
keepalive: true,
headers: {
"Content-Type": "application/json",
},
body: "{}",
}).catch(function () {
// ignore network issues; next interval will retry
});
};
ping();
setInterval(ping, 15000);
})();