import { Server, Socket } from 'socket.io';
import Models, { sequelize } from "../api/models";
import { Op } from "sequelize";
import { LIVE_STREAM, STREAK } from "../api/config/constants";
import moment from 'moment-timezone';
import { Common } from "../utils/common";
import AppCache from "../utils/appCache";
// import { ChatService } from "../api/services/chat.service";

export const registerSocketEvents = async (socket: Socket) => {
	socket.on('updateCache', async (payload: any) => {
		if(payload.value)
			AppCache.set(payload.index,payload.value);
		else
			AppCache.del(payload.index);
		return;
	});
}

