Commit 32784fed authored by Hugh Davenport's avatar Hugh Davenport
Browse files

Check import dir exists before running cron over it



The cleanup cron job for imports fails if the import
directory doesn't exist. Fix is to add a check before.

Bug #776955

Change-Id: I7b7c5524703eba5585553960649baff09e494918
Signed-off-by: default avatarHugh Davenport <hugh@catalyst.net.nz>
parent 53348d27
......@@ -564,6 +564,9 @@ class MnetImporterTransport extends ImporterTransport {
function import_cleanup_old_imports() {
require_once('file.php');
$basedir = get_config('dataroot') . 'import/';
if (!check_dir_exists($basedir, false)) {
return;
}
$importdir = new DirectoryIterator($basedir);
$mintime = time() - (12 * 60 * 60); // delete imports older than 12 hours
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment