feat(cmd): stop flood/notify.

fix(cmd): bad return.
chore(deps): upgrade all.
This commit is contained in:
vulet 2022-01-24 17:53:34 +08:00
parent 35cec7751f
commit 3b16a0495c
6 changed files with 217 additions and 202 deletions

View file

@ -1,5 +1,15 @@
exports.runQuery = function (roomId) {
setInterval(() => {
let intervalId = null;
exports.runQuery = function (roomId, disable) {
if (intervalId) {
clearInterval(intervalId);
intervalId = null;
}
if (disable) return;
intervalId = setInterval(() => {
axios({
method: 'GET',
url: `${config.fediverse.domain}/api/v1/notifications`,