简体   繁体   中英

Gulp 4 task with node-mysql2 module causing server crash on connect

I have a need to run mysql queries within gulp to check certain fields in a table. I currently connect to a development server via ssh tunnel, which is opened via terminal so that my host is set to 'localhost'.

When I execute a connection attempt, the tunnel crashes with: channel 4: open failed: connect failed: Connection refused

Then the server process crashes with an out of memory error.

We use node-mysql2 and a ssh tunnel to run GraphQL locally for testing, so I can't think of anything in particular in gulp that would cause what is essentially a race condition almost instantaneously from the time that the gulp command is sent.

Gulp Code: 在此处输入图片说明

If anyone has any insights I'd be much obliged.

Fix can be found here, thanks to the mysql2 developer for pointing me in the right direction!

More info on fix here: https://stackoverflow.com/a/30669454/705115

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM