MySQL fails after waking from Suspend – Wait for Network?

I am running Kodi (latest Libreelec) on an Intel i5 NUC and I am using the suspend mode when the machine is not in use. Also I am using a MySQL database.
The problem is that often after waking the machine and trying to play a movie I get the message like “The video is not available. Should it be removed from the database?”.

I can see MySQL connection errors in the log so it seems like Kodi could not access the database right after waking up after suspend.

This is the log:

Code:
21:23:00 T:140035462526720  NOTICE: service.libraryautoupdate-0.9.8 : Player is running, wait until finished
21:27:43 T:140035911641152  NOTICE: Previous line repeats 4 times.
21:27:43 T:140035911641152  NOTICE: CDVDPlayer::CloseFile()
21:27:43 T:140035911641152  NOTICE: DVDPlayer: waiting for threads to exit
21:27:43 T:140033222727424  NOTICE: CDVDPlayer::OnExit()
21:27:43 T:140033222727424  NOTICE: Closing stream player 1
21:27:43 T:140033222727424  NOTICE: Waiting for audio thread to exit
21:27:43 T:140033575085824  NOTICE: thread end: CDVDPlayerAudio::OnExit()
21:27:43 T:140033222727424  NOTICE: Closing audio device
21:27:44 T:140033222727424  NOTICE: Deleting audio codec
21:27:44 T:140033222727424  NOTICE: Closing stream player 2
21:27:44 T:140033222727424  NOTICE: waiting for video thread to exit
21:27:44 T:140033256990464  NOTICE: thread end: video_thread
21:27:44 T:140033222727424  NOTICE: deleting video codec
21:27:44 T:140033222727424  NOTICE: Closing stream player 3
21:27:44 T:140035911641152  NOTICE: DVDPlayer: finished waiting
21:27:44 T:140035911641152  NOTICE: VAAPI::Close
21:27:44 T:140033533130496  NOTICE: COutput::OnExit: Output Thread terminated
21:27:44 T:140035911641152  NOTICE: VAAPI::Close - closing decoder context
21:27:44 T:140035911641152  NOTICE: CWinSystemX11::SetFullScreen - calling xrandr
21:27:44 T:140035911641152  NOTICE: CDVDPlayer::CloseFile()
21:27:44 T:140035911641152  NOTICE: DVDPlayer: waiting for threads to exit
21:27:44 T:140035911641152  NOTICE: DVDPlayer: finished waiting
21:27:44 T:140035911641152  NOTICE: CDVDPlayer::CloseFile()
21:27:44 T:140035911641152  NOTICE: DVDPlayer: waiting for threads to exit
21:27:44 T:140035911641152  NOTICE: DVDPlayer: finished waiting
21:27:44 T:140033222727424  NOTICE: script.tv.show.next.aired: ### TV Show - Next Aired starting GUI proc (6.0.15)
21:28:00 T:140035462526720  NOTICE: service.libraryautoupdate-0.9.8 : Skipping scan, only run when idle
21:29:17 T:140035911641152  NOTICE: Previous line repeats 1 times.
21:29:17 T:140035911641152  NOTICE: Samba is idle. Closing the remaining connections
21:30:00 T:140035462526720  NOTICE: service.libraryautoupdate-0.9.8 : Skipping scan, only run when idle
21:31:00 T:140035462526720  NOTICE: service.libraryautoupdate-0.9.8 : Starting network check
21:31:00 T:140035462526720  NOTICE: service.libraryautoupdate-0.9.8 : Videobibliothek aktualisieren paused due to playback
21:33:00 T:140035462526720  NOTICE: service.libraryautoupdate-0.9.8 : Starting network check
21:33:00 T:140035462526720  NOTICE: service.libraryautoupdate-0.9.8 : Videobibliothek aktualisieren
21:33:00 T:140033256990464  NOTICE: VideoInfoScanner: Starting scan ..
21:33:02 T:140033256990464 WARNING: Process directory 'smb://BEN/MASS2/Video/TV Shows/Aufstand der Barbaren/' does not exist - skipping scan.
21:33:02 T:140033256990464 WARNING: Process directory 'smb://BEN/MASS2/Video/TV Shows/Fear The Walking Dead/' does not exist - skipping scan.
21:33:02 T:140033256990464 WARNING: Process directory 'smb://BEN/MASS2/Video/TV Shows/Unser Kosmos/' does not exist - skipping scan.
21:33:02 T:140033256990464  NOTICE: VideoInfoScanner: Finished scan. Scanning for video info took 00:02
21:34:35 T:140035911641152  NOTICE: Samba is idle. Closing the remaining connections
22:03:03 T:140035911641152  NOTICE: OnSleep: Running sleep jobs
22:03:03 T:140035911641152  NOTICE: OnSleep: Stopping lirc
22:03:03 T:140035911641152   ERROR: Keymapping error: no such action 'lirc.stop' defined
23:28:57 T:140035901097728   ERROR: ActiveAE::UnconfigureSink - failed to unconfigure
23:28:57 T:140033726056192  NOTICE: ES: Client  from 127.0.0.1 timed out
23:28:57 T:140035911641152   ERROR: Keymapping error: no such action 'lirc.start' defined
23:28:57 T:140035911641152  NOTICE: OnWake: Running resume jobs
23:28:57 T:140035911641152  NOTICE: OnWake: Restarting lirc
23:28:57 T:140035901097728  NOTICE: Found 2 Lists of Devices
23:28:57 T:140035901097728  NOTICE: Enumerated ALSA devices:
23:28:57 T:140035901097728  NOTICE:     Device 1
23:28:57 T:140035901097728  NOTICE:         m_deviceName      : hdmi:CARD=HDMI,DEV=0
23:28:57 T:140035901097728  NOTICE:         m_displayName     : HDA Intel
23:28:57 T:140035901097728  NOTICE:         m_displayNameExtra: SAM SAMSUNG on HDMI
23:28:57 T:140035901097728  NOTICE:         m_deviceType      : AE_DEVTYPE_HDMI
23:28:57 T:140035901097728  NOTICE:         m_channels        : FL,FR,LFE,FC,BL,BR,BC,BLOC,BROC
23:28:57 T:140035901097728  NOTICE:         m_sampleRates     : 32000,44100,48000,88200,96000,176400,192000
23:28:57 T:140035901097728  NOTICE:         m_dataFormats     : AE_FMT_LPCM,AE_FMT_AC3,AE_FMT_DTS,AE_FMT_EAC3,AE_FMT_TRUEHD,AE_FMT_DTSHD,AE_FMT_​S32NE,AE_FMT_S16NE,AE_FMT_S16LE,AE_FMT_AAC
23:28:57 T:140035901097728  NOTICE:     Device 2
23:28:57 T:140035901097728  NOTICE:         m_deviceName      : hdmi:CARD=HDMI,DEV=1
23:28:57 T:140035901097728  NOTICE:         m_displayName     : HDA Intel
23:28:57 T:140035901097728  NOTICE:         m_displayNameExtra: HDMI
23:28:57 T:140035901097728  NOTICE:         m_deviceType      : AE_DEVTYPE_HDMI
23:28:57 T:140035901097728  NOTICE:         m_channels        : FL,FR,LFE,FC,BC,BL,BR,FLOC,FROC,BLOC,BROC,TFC,TC,TFL,TFR,UNKNOWN1
23:28:57 T:140035901097728  NOTICE:         m_sampleRates     : 32000,44100,48000,88200,96000,176400,192000
23:28:57 T:140035901097728  NOTICE:         m_dataFormats     : AE_FMT_S32NE,AE_FMT_S16NE,AE_FMT_S16LE,AE_FMT_LPCM,AE_FMT_DTSHD,AE_FMT_TRUEHD,AE​_FMT_EAC3,AE_FMT_DTS,AE_FMT_AC3,AE_FMT_AAC
23:28:57 T:140035901097728  NOTICE: Enumerated PULSE devices:
23:28:57 T:140035901097728  NOTICE:     Device 1
23:28:57 T:140035901097728  NOTICE:         m_deviceName      : Default
23:28:57 T:140035901097728  NOTICE:         m_displayName     : Default
23:28:57 T:140035901097728  NOTICE:         m_displayNameExtra: Bluetooth Audio (PULSEAUDIO)
23:28:57 T:140035901097728  NOTICE:         m_deviceType      : AE_DEVTYPE_PCM
23:28:57 T:140035901097728  NOTICE:         m_channels        : FL,FR
23:28:57 T:140035901097728  NOTICE:         m_sampleRates     : 5512,8000,11025,16000,22050,32000,44100,48000,64000,88200,96000,176400,192000,38​4000
23:28:57 T:140035901097728  NOTICE:         m_dataFormats     : AE_FMT_U8,AE_FMT_S16NE,AE_FMT_S24NE3,AE_FMT_S24NE4,AE_FMT_S32NE,AE_FMT_FLOAT
23:28:59 T:140035901097728  NOTICE: Found 2 Lists of Devices
23:28:59 T:140035901097728  NOTICE: Enumerated ALSA devices:
23:28:59 T:140035901097728  NOTICE:     Device 1
23:28:59 T:140035901097728  NOTICE:         m_deviceName      : hdmi:CARD=HDMI,DEV=0
23:28:59 T:140035901097728  NOTICE:         m_displayName     : HDA Intel
23:28:59 T:140035901097728  NOTICE:         m_displayNameExtra: HDMI #0
23:28:59 T:140035901097728  NOTICE:         m_deviceType      : AE_DEVTYPE_HDMI
23:28:59 T:140035901097728  NOTICE:         m_channels        : FL,FR,LFE,FC,BC,BL,BR,FLOC,FROC,BLOC,BROC,TFC,TC,TFL,TFR,UNKNOWN1
23:28:59 T:140035901097728  NOTICE:         m_sampleRates     : 32000,44100,48000,88200,96000,176400,192000
23:28:59 T:140035901097728  NOTICE:         m_dataFormats     : AE_FMT_S32NE,AE_FMT_S16NE,AE_FMT_S16LE,AE_FMT_LPCM,AE_FMT_DTSHD,AE_FMT_TRUEHD,AE​_FMT_EAC3,AE_FMT_DTS,AE_FMT_AC3,AE_FMT_AAC
23:28:59 T:140035901097728  NOTICE:     Device 2
23:28:59 T:140035901097728  NOTICE:         m_deviceName      : hdmi:CARD=HDMI,DEV=1
23:28:59 T:140035901097728  NOTICE:         m_displayName     : HDA Intel
23:28:59 T:140035901097728  NOTICE:         m_displayNameExtra: HDMI #1
23:28:59 T:140035901097728  NOTICE:         m_deviceType      : AE_DEVTYPE_HDMI
23:28:59 T:140035901097728  NOTICE:         m_channels        : FL,FR,LFE,FC,BC,BL,BR,FLOC,FROC,BLOC,BROC,TFC,TC,TFL,TFR,UNKNOWN1
23:28:59 T:140035901097728  NOTICE:         m_sampleRates     : 32000,44100,48000,88200,96000,176400,192000
23:28:59 T:140035901097728  NOTICE:         m_dataFormats     : AE_FMT_S32NE,AE_FMT_S16NE,AE_FMT_S16LE,AE_FMT_LPCM,AE_FMT_DTSHD,AE_FMT_TRUEHD,AE​_FMT_EAC3,AE_FMT_DTS,AE_FMT_AC3,AE_FMT_AAC
23:28:59 T:140035901097728  NOTICE: Enumerated PULSE devices:
23:28:59 T:140035901097728  NOTICE:     Device 1
23:28:59 T:140035901097728  NOTICE:         m_deviceName      : Default
23:28:59 T:140035901097728  NOTICE:         m_displayName     : Default
23:28:59 T:140035901097728  NOTICE:         m_displayNameExtra: Bluetooth Audio (PULSEAUDIO)
23:28:59 T:140035901097728  NOTICE:         m_deviceType      : AE_DEVTYPE_PCM
23:28:59 T:140035901097728  NOTICE:         m_channels        : FL,FR
23:28:59 T:140035901097728  NOTICE:         m_sampleRates     : 5512,8000,11025,16000,22050,32000,44100,48000,64000,88200,96000,176400,192000,38​4000
23:28:59 T:140035901097728  NOTICE:         m_dataFormats     : AE_FMT_U8,AE_FMT_S16NE,AE_FMT_S24NE3,AE_FMT_S24NE4,AE_FMT_S32NE,AE_FMT_FLOAT
23:28:59 T:140033256990464   ERROR: CCurlFile::Stat - Failed: Couldn't resolve host name(6) for http://thetvdb.com/banners/episodes/274431/4989335.jpg
23:28:59 T:140033247901440   ERROR: Unable to open database: MyVideos99 [2003](Can't connect to MySQL server on '192.168.2.33' (101))
23:29:02 T:140033256990464   ERROR: Previous line repeats 1 times.
23:29:02 T:140033256990464   ERROR: CCurlFile::Stat - Failed: Couldn't resolve host name(6) for http://thetvdb.com/banners/episodes/274431/4989335.jpg
23:29:02 T:140033247901440   ERROR: Unable to open database: MyVideos99 [2003](Can't connect to MySQL server on '192.168.2.33' (101))
23:29:03 T:140035911641152   ERROR: Previous line repeats 1 times.
23:29:03 T:140035911641152   ERROR: GetResumeItemOffset - Cannot open VideoDatabase
23:29:21 T:140033281738496  NOTICE: script.tv.show.next.aired: ### TV Show - Next Aired starting GUI proc (6.0.15)
23:29:58 T:140033726056192  NOTICE: ES: Client  from 127.0.0.1 timed out
23:29:59 T:140034841761536  NOTICE: script.tv.show.next.aired: ### starting data update
23:30:00 T:140034841761536  NOTICE: script.tv.show.next.aired: ### getting series info for #254874 - Der Tatortreiniger
23:30:00 T:140034841761536   ERROR: script.tv.show.next.aired: ### ERROR returned by get_show(): syntax error: line 1, column 49
23:30:00 T:140034841761536  NOTICE: script.tv.show.next.aired: ### getting series info for #254874 - Der Tatortreiniger
23:30:00 T:140034841761536   ERROR: script.tv.show.next.aired: ### ERROR returned by get_show(): syntax error: line 1, column 49
23:30:00 T:140034841761536  NOTICE: script.tv.show.next.aired: ### no result: continuing to use the old data
23:30:00 T:140034841761536  NOTICE: script.tv.show.next.aired: ### data update finished
23:30:07 T:140033290131200  NOTICE: script.tv.show.next.aired: ### TV Show - Next Aired starting GUI proc (6.0.15)
23:31:45 T:140035911641152  NOTICE: Samba is idle. Closing the remaining connections

The machine is waking up here:

Code:
23:28:57 T:140035911641152  NOTICE: OnWake: Running resume jobs

Then two seconds later it tries to access the DB and fails:

Code:
23:28:59 T:140033247901440   ERROR: Unable to open database: MyVideos99 [2003](Can't connect to MySQL server on '192.168.2.33' (101))

I suspect that the network device is not up after suspend when Kodi tries to access the network DB. Is there any chance to make Kodi wait for network after waking up from suspend?