mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-22 11:42:26 +00:00
Make presence clear async, clean up temp session code
This commit is contained in:
1 parent
05fba68bb3
commit
e0204f76cf
4 files changed
+23
-22
No files matched your search
@@ -16,7 +16,7 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { arrayDistinctBy, arrayGroupBy, Config, EmbedCache, emitEvent, Message, MessageUpdateEvent, normalizeUrl, OrmUtils } from "@spacebar/util";
|
||||
import { arrayDistinctBy, arrayGroupBy, Config, EmbedCache, emitEvent, Message, MessageUpdateEvent, normalizeUrl, OrmUtils, sleep } from "@spacebar/util";
|
||||
import { Embed, EmbedImage, EmbedType } from "@spacebar/schemas";
|
||||
import * as cheerio from "cheerio";
|
||||
import crypto from "crypto";
|
||||
@@ -572,10 +572,6 @@ export async function dropDuplicateCacheEntries(entries: EmbedCache[]): Promise<
|
||||
);
|
||||
}
|
||||
|
||||
async function sleep(ms: number) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
// hack to make nodejs not die
|
||||
function getSlowdownFactor(off: number) {
|
||||
if (off < 10) return off;
|
||||
|
||||
Reference in new issue
Block a user