File tree Expand file tree Collapse file tree 9 files changed +902
-781
lines changed Expand file tree Collapse file tree 9 files changed +902
-781
lines changed Original file line number Diff line number Diff line change 3131 "url" : " http://github.com/odota/core"
3232 },
3333 "dependencies" : {
34- "@aws-sdk/client-s3" : " ^3.726 .0" ,
34+ "@aws-sdk/client-s3" : " ^3.879 .0" ,
3535 "@elastic/elasticsearch" : " ^7.17.14" ,
3636 "ansi-colors" : " ^4.1.3" ,
3737 "axios" : " ^1.7.9" ,
5050 "moment" : " ^2.30.1" ,
5151 "passport" : " ^0.5.3" ,
5252 "passport-steam" : " ^1.0.18" ,
53- "pg" : " ^8.13.1 " ,
53+ "pg" : " ^8.16.3 " ,
5454 "pg-query-stream" : " ^4.7.1" ,
5555 "pm2" : " ^6.0.8" ,
5656 "protobufjs" : " ^7.2.5" ,
Original file line number Diff line number Diff line change 11import constants from 'dotaconstants' ;
22import moment from 'moment' ;
3- import pg from 'pg' ;
3+ import { Client } from 'pg' ;
44import config from '../../config.ts' ;
55import { addJob , addReliableJob , getReliableJob } from '../store/queue.ts' ;
66import { search } from '../store/search.ts' ;
@@ -50,7 +50,6 @@ import {
5050 getItemTimings ,
5151 isSubscriber ,
5252} from '../util/queries.ts' ;
53- const { Client } = pg ;
5453import heroParams from './requests/heroParams.ts' ;
5554import leagueParams from './requests/leagueParams.ts' ;
5655import matchParams from './requests/matchParams.ts' ;
Original file line number Diff line number Diff line change 11import type { PutObjectCommandInput , PutObjectCommandOutput } from '@aws-sdk/client-s3' ;
22import config from '../../config.ts' ;
33import { gzipSync , gunzipSync } from 'zlib' ;
4- import s3 from '@aws-sdk/client-s3' ;
4+ import { S3Client , PutObjectCommand , GetObjectCommand } from '@aws-sdk/client-s3' ;
55import { redisCount } from '../util/utility.ts' ;
66import axios from 'axios' ;
77
8- const { S3Client, PutObjectCommand, GetObjectCommand } = s3 ;
9-
108async function stream2buffer ( stream : any ) : Promise < Buffer > {
119 return new Promise ( ( resolve , reject ) => {
1210 const _buf : any [ ] = [ ] ;
@@ -21,7 +19,7 @@ class Archive {
2119 private accessKeyId : string = '' ;
2220 private secretAccessKey : string = '' ;
2321 private bucket : string = '' ;
24- private client : s3 . S3Client | null = null ;
22+ private client : S3Client | null = null ;
2523 constructor ( type : 'match' | 'player' | 'blob' ) {
2624 this . endpoint = config . ARCHIVE_S3_ENDPOINT ;
2725 this . accessKeyId = config . ARCHIVE_S3_KEY_ID ;
Original file line number Diff line number Diff line change 1- import pg from 'pg' ;
1+ import { types } from 'pg' ;
22import knex from 'knex' ;
33import config from '../../config.ts' ;
44// remember: all values returned from the server are either NULL or a string
5- pg . types . setTypeParser ( 20 , ( val ) => ( val === null ? null : parseInt ( val , 10 ) ) ) ;
5+ types . setTypeParser ( 20 , ( val ) => ( val === null ? null : parseInt ( val , 10 ) ) ) ;
66console . log ( 'connecting %s' , config . POSTGRES_URL ) ;
77export const db = knex ( {
88 client : 'pg' ,
Original file line number Diff line number Diff line change @@ -3,11 +3,9 @@ import redis from './redis.ts';
33import db from './db.ts' ;
44import { Redis } from 'ioredis' ;
55import config from '../../config.ts' ;
6- import pg from 'pg' ;
6+ import { Client } from 'pg' ;
77import c from 'ansi-colors' ;
88
9- const { Client } = pg ;
10-
119moment . relativeTimeThreshold ( 'ss' , 0 ) ;
1210
1311export async function runQueue (
Original file line number Diff line number Diff line change 11import config from '../../config.ts' ;
22import { matchArchive , playerArchive } from '../store/archive.ts' ;
33import QueryStream from 'pg-query-stream' ;
4- import pg from 'pg' ;
4+ import { Client } from 'pg' ;
55import db from '../store/db.ts' ;
66import type { PutObjectCommandOutput } from '@aws-sdk/client-s3' ;
77import { getFullPlayerMatchesWithMetadata } from './buildPlayer.ts' ;
88import { getMatchDataFromBlobWithMetadata } from './buildMatch.ts' ;
99import { isDataComplete , randomInt , redisCount } from './utility.ts' ;
1010
11- const { Client } = pg ;
12-
1311async function processMatch ( matchId : number ) {
1412 // Check if we should archive the blobs (should be parsed and not archived)
1513 // const isParsed = await checkIsParsed(matchId);
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import nock from 'nock';
88import assert from 'assert' ;
99import supertest from 'supertest' ;
1010import stripe from '../svc/store/stripe.ts' ;
11- import pg from 'pg' ;
11+ import { Pool } from 'pg' ;
1212import { readFileSync } from 'fs' ;
1313import url from 'url' ;
1414import { Client } from 'cassandra-driver' ;
@@ -31,11 +31,8 @@ import redis from '../svc/store/redis.ts';
3131import db from '../svc/store/db.ts' ;
3232import cassandra from '../svc/store/cassandra.ts' ;
3333import c from 'ansi-colors' ;
34- import s3 from '@aws-sdk/client-s3' ;
34+ import { CreateBucketCommand , S3Client } from '@aws-sdk/client-s3' ;
3535
36- const { CreateBucketCommand, S3Client } = s3 ;
37-
38- const { Pool } = pg ;
3936const { RETRIEVER_HOST , POSTGRES_URL , CASSANDRA_URL } = config ;
4037const initPostgresHost = POSTGRES_URL . replace ( '/yasp_test' , '/postgres' ) ;
4138const initCassandraHost = url . parse ( CASSANDRA_URL ) . host as string ;
Original file line number Diff line number Diff line change 11{
22 "compilerOptions" : {
33 "target" : " es2020" ,
4- "module" : " NodeNext " ,
4+ "module" : " nodenext " ,
55 "allowJs" : true ,
66 "strict" : true ,
77 "esModuleInterop" : true ,
8- "outDir" : " ./build" ,
98 "resolveJsonModule" : true ,
109 "noEmit" : true ,
1110 "allowImportingTsExtensions" : true
You can’t perform that action at this time.
0 commit comments