Commit f5109402 authored by Hugo "ThePooN" Denizart's avatar Hugo "ThePooN" Denizart
Browse files

馃悰 Fix cronjob mongoose connection issue

And probably more issues elsewhere
parent 871a903f
Pipeline #4822 canceled with stage
......@@ -95,7 +95,6 @@ export class App {
this.logger.info("Starting app...");
// @ts-ignore mongoose typings don't have autoIndex
mongoose.connect(this.config.mongo.uri, { autoIndex: false });
mongoose.connection.on("error", (error) =>
Logger.getLogger("mongo").error("Connection error:", { error }));
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { ITeam, ITeamInfos, Team } from "./Team";
import { IUser, User, IUserInfos } from "./User";
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { ITeam, ITeamInfos } from "./Team";
import { IMatch, IMatchInfos, Match } from "./Match";
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
export interface IMap extends mongoose.Document {
setID: number;
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { ITeam, ITeamInfos, Team } from "./Team";
import { IStage } from "./Stage";
import { IMap, MapSchema, Mappool } from "./Mappool"
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { IUser } from "./User";
import { IMatch, Match } from "./Match";
import { ITeam, Team } from "./Team";
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { ITeam, ITeamInfos, Team } from "./Team";
import { IUser, IUserInfos, User } from "./User";
import { IMatchPlay, MatchPlaySchema, IMatchPlayInfos } from "./Match";
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { IMatch, IMatchInfos } from "./Match";
export interface IStage extends mongoose.Document {
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import * as _ from "lodash";
import { IUser, User, IUserInfos } from "./User";
import { ITeamInvite, TeamInvite } from "./TeamInvite";
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { ITeam, ITeamInfos, Team } from "./Team";
import { IUser, IUserInfos, User } from "./User";
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import * as Discord from "discord.js";
import { Logger } from "../Logger";
import { ITeam, ITeamInfos, Team } from "./Team";
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { App } from "../App";
import { Logger } from "../Logger";
import { IScript } from "../misc-models/IScript";
......@@ -8,7 +8,6 @@ export default class FixTeamsMembersAmount implements IScript {
private static logger = Logger.getLogger("scripts/fix-teams-membersamount");
public async run() {
// @ts-ignore mongoose typings don't have autoIndex
if(mongoose.connection.readyState === 0) {
FixTeamsMembersAmount.logger.info("Connecting to database...");
await mongoose.connect(App.instance.config.mongo.uri);
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { App } from "../App";
import { Logger } from "../Logger";
import { IScript } from "../misc-models/IScript";
......@@ -9,7 +9,6 @@ export default class PurgeTeams implements IScript {
private static logger = Logger.getLogger("scripts/purge-teams");
public async run() {
// @ts-ignore mongoose typings don't have autoIndex
if(mongoose.connection.readyState === 0) {
PurgeTeams.logger.info("Connecting to database...");
await mongoose.connect(App.instance.config.mongo.uri);
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { App } from "../App";
import { Logger } from "../Logger";
import { IScript } from "../misc-models/IScript";
......@@ -8,7 +8,6 @@ export default class PurgeUsers implements IScript {
private static logger = Logger.getLogger("scripts/purge-users");
public async run() {
// @ts-ignore mongoose typings don't have autoIndex
if(mongoose.connection.readyState === 0) {
PurgeUsers.logger.info("Connecting to database...");
await mongoose.connect(App.instance.config.mongo.uri);
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { App } from "../App";
import { Logger } from "../Logger";
import { IScript } from "../misc-models/IScript";
......@@ -10,7 +10,6 @@ export default class RefreshAllUserData implements IScript {
private static readonly CONCURRENCY = 20;
public async run() {
// @ts-ignore mongoose typings don't have autoIndex
if(mongoose.connection.readyState === 0) {
RefreshAllUserData.logger.info("Connecting to database...");
await mongoose.connect(App.instance.config.mongo.uri);
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { App } from "../App";
import { Logger } from "../Logger";
import { IScript } from "../misc-models/IScript";
......@@ -11,7 +11,6 @@ export default class DiscordRolesRefresh implements IScript {
private static readonly CONCURRENCY = 20;
public async run() {
// @ts-ignore mongoose typings don't have autoIndex
if(mongoose.connection.readyState === 0) {
DiscordRolesRefresh.logger.info("Connecting to database...");
await mongoose.connect(App.instance.config.mongo.uri);
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { App } from "../App";
import { Logger } from "../Logger";
import { IScript } from "../misc-models/IScript";
......@@ -10,7 +10,6 @@ export default class RefreshOsuUsernames implements IScript {
private static readonly CONCURRENCY = 20;
public async run() {
// @ts-ignore mongoose typings don't have autoIndex
if(mongoose.connection.readyState === 0) {
RefreshOsuUsernames.logger.info("Connecting to database...");
await mongoose.connect(App.instance.config.mongo.uri);
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { App } from "../App";
import { Logger } from "../Logger";
import { IScript } from "../misc-models/IScript";
......@@ -8,7 +8,6 @@ export default class RefreshRanks implements IScript {
private static logger = Logger.getLogger("scripts/refresh-ranks");
public async run() {
// @ts-ignore mongoose typings don't have autoIndex
if(mongoose.connection.readyState === 0) {
RefreshRanks.logger.info("Connecting to database...");
await mongoose.connect(App.instance.config.mongo.uri);
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { App } from "../App";
import { Logger } from "../Logger";
import { IScript } from "../misc-models/IScript";
......@@ -8,7 +8,6 @@ export default class RefreshUserData implements IScript {
private static logger = Logger.getLogger("scripts/refresh-user-data");
public async run() {
// @ts-ignore mongoose typings don't have autoIndex
if(mongoose.connection.readyState === 0) {
RefreshUserData.logger.info("Connecting to database...");
await mongoose.connect(App.instance.config.mongo.uri);
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { App } from "../App";
import { Logger } from "../Logger";
import { IScript } from "../misc-models/IScript";
......@@ -11,7 +11,6 @@ export default class RestoreTeams implements IScript {
private static readonly CONCURRENCY = 20;
public async run() {
// @ts-ignore mongoose typings don't have autoIndex
if(mongoose.connection.readyState === 0) {
RestoreTeams.logger.info("Connecting to database...");
await mongoose.connect(App.instance.config.mongo.uri);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment