Ad Distribution Code Improved

After a 2-hour outage, came up with an idea to redistribute ad from two server, in which one is main server and other is the backup one, checking for the connection to the main server in 2 sec, then 2 sec for verifying the backup server is also online, if after 4 sec there is no server online, the ad distribution code will terminate by returning nothing.

This would help the main script work normally with failure in request for ads.

The precedent code, there was no function for 2 servers, and there was even no time-out for the script execution this led to the fatal error “Execution Time” and the main script could not work either.

2 hours for a new method :( but the server is still so unstable now.