Nodemcu with blynk constantly keeps connecting and disconnecting

I wold start by simplifying your code and app setup so that you do nothing other than connect to Blynk within the sketch, and have no widgets in the app.
Observe what happens with your Blynk connection.

If it still disconnects then the problem lies either with your NodeMCU, Router or ISP.

If it stays online then the problem lies with your sketch or app setup.

I’d always recommend using virtual pins (which do require a pinMode statement in your sketch). Read this:

You will also see from that tutorial how to synchronise your relays with the app when the device boots-up or re-connects with Blynk.

What would happen then is that the code would enter the void loop, execute the Blynk.run command then do nothing for 1 day. At the end of that day, the next line of code would be executed, which would restart the device.
10 seconds into this one day delay, the Blynk server would disconnect your device because it had stopped doing handshakes with the server - which are part of the Blynk.run command.

This is because delay() is a blocking command. It blocks all code execution, and therefore freezes the device, until the delay period has completed.

On a different note, it your device, router and ISP turn-out to be fine, I’d recommend migrating to Blynk IoT, as the version you are currently using has a limited life and is no longer being developed or supported…

Pete.