Site to Site IPsec VPN Switch GW

I know how to use  More than 1 gateway for VPN failover  . but i have strange issue with Site to site VPN . i am using two different gateways and sometimes the VPN disconnect and what ever i do it never restore the connection unless i wait almost 15 minutes to reconnect using same gateway . the only fix it to switch the vpn gateway to use the  second gateway .

put in mind that both gateways are connected to the Internet and online and this issue happen while both gateways are online .  dpd is enabled 

so the only fix i am thinking about is to monitor an IP in the end of the VPN tunnel and switch the gateway for the vpn connection once that IP fail to ping 

so can anyone help in this ?

PS:  i couldn't find any useful info in the logs .