fix cache

This commit is contained in:
Skillz
2020-05-11 16:00:40 -04:00
parent 39121a37a9
commit 926d6887c5
2 changed files with 0 additions and 8 deletions

View File

@@ -41,7 +41,6 @@ export const createShard = async (
botGatewayData: DiscordBotGatewayData,
identifyPayload: object,
) => {
console.log("inside create shard");
const shardSocket = await connectWebSocket(botGatewayData.url);
let resumeInterval = 0;
@@ -101,7 +100,6 @@ postMessage({ type: "REQUEST_CLIENT_OPTIONS" });
// @ts-ignore
onmessage = (message) => {
if (message.data.type === "CREATE_SHARD") {
console.log("shard need to make shard");
createShard(
message.data.botGatewayData,
message.data.identifyPayload,

View File

@@ -58,14 +58,10 @@ import { createMessage } from "../structures/message.ts";
let shardCounter = 0;
function createShardWorker() {
// console.log("shard creating url", import.meta.url);
const path = new URL("./shard.ts", import.meta.url).toString();
// console.log("shard creating path", path);
const shard = new Worker(path, { type: "module", deno: true });
// console.log("shard made on manager");
shard.onmessage = (message) => {
if (message.data.type === "REQUEST_CLIENT_OPTIONS") {
// console.log("sending client options");
identifyPayload.shard = [shardCounter++, botGatewayData.shards];
shard.postMessage(
{
@@ -75,7 +71,6 @@ function createShardWorker() {
},
);
} else if (message.data.type === "HANDLE_DISCORD_PAYLOAD") {
// console.log("manager payload");
handleDiscordPayload(JSON.parse(message.data.payload));
}
};
@@ -316,7 +311,6 @@ function handleDiscordPayload(data: DiscordPayload) {
const message = createMessage(options);
cache.messages.set(options.id, message);
if (options.member && options.guild_id) {
console.log("message create member", options);
const guild = cache.guilds.get(options.guild_id);
guild?.members.set(
options.author.id,