Skip to content

Commit

Permalink
👌 IMPROVE: syncPackageWorkerMaxConcurrentTasks up to 20 (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 authored Oct 2, 2022
1 parent 5852f22 commit bbc08fd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/config.default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default (appInfo: EggAppConfig) => {
// - exist: only sync exist packages, effected when `enableCheckRecentlyUpdated` or `enableChangesStream` is enabled
syncMode: 'none',
hookEnable: false,
syncPackageWorkerMaxConcurrentTasks: 10,
syncPackageWorkerMaxConcurrentTasks: 20,
triggerHookWorkerMaxConcurrentTasks: 10,
createTriggerHookWorkerMaxConcurrentTasks: 10,
// stop syncing these packages in future
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
},
"devDependencies": {
"@types/mocha": "^9.0.0",
"@types/mysql": "^2.15.21",
"@types/semver": "^7.3.12",
"coffee": "^5.4.0",
"egg-bin": "^4.16.4",
"egg-mock": "^4.2.0",
Expand Down
8 changes: 4 additions & 4 deletions test/TestUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ export class TestUtil {
return sqls.join('\n');
}

static async query(sql): Promise<any[]> {
static async query(sql: string): Promise<any[]> {
const conn = this.getConnection();
return new Promise((resolve, reject) => {
conn.query(sql, (err, rows) => {
conn.query(sql, (err: Error, rows: any[]) => {
if (err) {
return reject(err);
}
Expand All @@ -78,7 +78,7 @@ export class TestUtil {

static getConnection() {
if (!this.connection) {
const config = this.getMySqlConfig();
const config: any = this.getMySqlConfig();
if (process.env.CI) {
console.log('[TestUtil] connection to mysql: %j', config);
}
Expand Down Expand Up @@ -123,7 +123,7 @@ export class TestUtil {
static async truncateDatabase() {
const database = this.getDatabase();
const tables = await this.getTableNames();
await Promise.all(tables.map(table => this.query(`TRUNCATE TABLE ${database}.${table};`)));
await Promise.all(tables.map((table: string) => this.query(`TRUNCATE TABLE ${database}.${table};`)));
}

static get app() {
Expand Down

0 comments on commit bbc08fd

Please sign in to comment.