chore: adjust gha agent params (#13509)

This commit is contained in:
Yury Semikhatsky 2022-04-12 13:39:08 -07:00 committed by GitHub
parent 2a97ad2487
commit ae4d2e75aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 12 deletions

View File

@ -30,9 +30,10 @@ const log = debug(`pw:grid:server`);
const githubFactory: GridFactory = {
name: 'Agents hosted on Github',
capacity: 10,
launchTimeout: 30000,
retireTimeout: 600000,
// Standard VM is 3-core on mac and 2-core on win and lin
capacity: 4,
launchTimeout: 10 * 60_000,
retireTimeout: 1 * 60 * 60_000,
launch: async (options: GridAgentLaunchOptions) => {
await createWorkflow(options);
},

View File

@ -248,18 +248,12 @@ export class GridServer {
this._wsServer.shouldHandle = request => {
this._log(request.url);
if (request.url!.startsWith(this._securePath('/claimWorker'))) {
if (request.url!.startsWith(this._securePath('/claimWorker')) ||
request.url!.startsWith(this._securePath('/registerAgent')) ||
request.url!.startsWith(this._securePath('/registerWorker'))) {
// shouldHandle claims it accepts promise, except it doesn't.
return true;
}
if (request.url!.startsWith(this._securePath('/registerAgent'))
|| request.url!.startsWith(this._securePath('/registerWorker'))) {
const params = new URL('http://localhost/' + request.url).searchParams;
const agentId = params.get('agentId');
return !!agentId && this._agents.has(agentId);
}
return false;
};