From 9b7243140819a0b72b0af273be32ca3aef8666db Mon Sep 17 00:00:00 2001 From: Samuli Virtapohja <l4721@student.jamk.fi> Date: Wed, 24 Jul 2019 13:57:29 +0300 Subject: [PATCH] score folder audited --- src/score/score.entity.ts | 9 +-------- src/score/score.service.ts | 10 ++-------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/score/score.entity.ts b/src/score/score.entity.ts index a5321da..01fb60b 100644 --- a/src/score/score.entity.ts +++ b/src/score/score.entity.ts @@ -1,11 +1,4 @@ -import { - Entity, - PrimaryGeneratedColumn, - Column, - ManyToOne, - Timestamp, - CreateDateColumn, -} from 'typeorm'; +import { Entity, PrimaryGeneratedColumn, Column, ManyToOne } from 'typeorm'; import { FactionEntity } from '../faction/faction.entity'; @Entity('Score') diff --git a/src/score/score.service.ts b/src/score/score.service.ts index 7ef613d..5587f08 100644 --- a/src/score/score.service.ts +++ b/src/score/score.service.ts @@ -1,10 +1,4 @@ -import { - Injectable, - HttpException, - HttpStatus, - Logger, - OnModuleInit, -} from '@nestjs/common'; +import { Injectable, HttpException, HttpStatus } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { Repository } from 'typeorm'; @@ -57,6 +51,7 @@ export class ScoreService { }; } + // function to run on timer tick async scoreTick(gameId) { // get game's flagboxes const flagboxes = await this.flagRepository.find({ game: gameId }); @@ -110,7 +105,6 @@ export class ScoreService { }); //if score was found, put info to scores array if (score.faction) { - let index = await scores.findIndex(i => i.faction === score.faction); scores.push(score); } }), -- GitLab