WordPress database error: [INSERT, UPDATE command denied to user '51213-2'@'10.10.20.81' for table 'wp_options']INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('_transient_doing_cron', '1715215307.3684620857238769531250', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)
But it can be quite long, especially when the file is on a network drive. If so you’ll have to wait for a time-out to know that the file is not reachable.
This was too slow for me so I coded this little utility which performs the same but with a customizable TimeOut. As it may interest you, here it is:
[csharp]private static bool VerifyFileExists(Uri uri, int timeout)
{
var task = new Task<bool>(() =>
{
var fi = new FileInfo(uri.LocalPath);
return fi.Exists;
});
task.Start();
return task.Wait(timeout) && task.Result;
}
[/csharp]
Enjoy !
]]>