mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-30 06:53:09 +02:00
fix of 65557d5f27
This commit is contained in:
parent
65557d5f27
commit
547be1973d
1 changed files with 5 additions and 5 deletions
|
@ -7,7 +7,7 @@ import { Inject, Injectable } from '@nestjs/common';
|
||||||
import * as Redis from 'ioredis';
|
import * as Redis from 'ioredis';
|
||||||
import { ModuleRef } from '@nestjs/core';
|
import { ModuleRef } from '@nestjs/core';
|
||||||
import * as Reversi from 'misskey-reversi';
|
import * as Reversi from 'misskey-reversi';
|
||||||
import { IsNull, LessThan } from 'typeorm';
|
import { IsNull, LessThan, MoreThan } from 'typeorm';
|
||||||
import type {
|
import type {
|
||||||
MiReversiGame,
|
MiReversiGame,
|
||||||
ReversiGamesRepository,
|
ReversiGamesRepository,
|
||||||
|
@ -98,8 +98,8 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit {
|
||||||
// 既にマッチしている対局が無いか探す(3分以内)
|
// 既にマッチしている対局が無いか探す(3分以内)
|
||||||
const games = await this.reversiGamesRepository.find({
|
const games = await this.reversiGamesRepository.find({
|
||||||
where: [
|
where: [
|
||||||
{ id: LessThan(this.idService.gen(Date.now() - 1000 * 60 * 3)), user1Id: me.id, user2Id: targetUser.id, isStarted: false },
|
{ id: MoreThan(this.idService.gen(Date.now() - 1000 * 60 * 3)), user1Id: me.id, user2Id: targetUser.id, isStarted: false },
|
||||||
{ id: LessThan(this.idService.gen(Date.now() - 1000 * 60 * 3)), user1Id: targetUser.id, user2Id: me.id, isStarted: false },
|
{ id: MoreThan(this.idService.gen(Date.now() - 1000 * 60 * 3)), user1Id: targetUser.id, user2Id: me.id, isStarted: false },
|
||||||
],
|
],
|
||||||
relations: ['user1', 'user2'],
|
relations: ['user1', 'user2'],
|
||||||
order: { id: 'DESC' },
|
order: { id: 'DESC' },
|
||||||
|
@ -140,8 +140,8 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit {
|
||||||
// 既にマッチしている対局が無いか探す(3分以内)
|
// 既にマッチしている対局が無いか探す(3分以内)
|
||||||
const games = await this.reversiGamesRepository.find({
|
const games = await this.reversiGamesRepository.find({
|
||||||
where: [
|
where: [
|
||||||
{ id: LessThan(this.idService.gen(Date.now() - 1000 * 60 * 3)), user1Id: me.id, isStarted: false },
|
{ id: MoreThan(this.idService.gen(Date.now() - 1000 * 60 * 3)), user1Id: me.id, isStarted: false },
|
||||||
{ id: LessThan(this.idService.gen(Date.now() - 1000 * 60 * 3)), user2Id: me.id, isStarted: false },
|
{ id: MoreThan(this.idService.gen(Date.now() - 1000 * 60 * 3)), user2Id: me.id, isStarted: false },
|
||||||
],
|
],
|
||||||
relations: ['user1', 'user2'],
|
relations: ['user1', 'user2'],
|
||||||
order: { id: 'DESC' },
|
order: { id: 'DESC' },
|
||||||
|
|
Loading…
Reference in a new issue