First time here? Check out the FAQ!
0

No longer getting new image data

Hello. We were getting image data up until recently using the code below. As of Wednesday June 24, 6:00am, our import started failing. We are getting other listing data but have been unable to retrieve image data since Wednesday. We have our script email us when it fails. Whatever error is taking place doesn't generate a failure state.

The code we're using is below. I'd appreciate any thoughts or leads on things we should check.

Thank you, David

if (count($mls_ids) > 0) {
    $today = date('Y-m-d H:i:s', time());
    foreach ($mls_ids as $mls) {
        //get photos
        $photos_array = array();
        $photos_array = $rets->GetObject("Property", "Photo", $mls, "*", 1);
        if (count($photos_array) > 0) {
            $count = 1;
            //delete current images
            $temp_record_delete_sql = "DELETE FROM `imgsDocs` WHERE `L_ListingID` = ".$mls." AND `type` = 'image'";
            if($connection->query($temp_record_delete_sql) === false) {
                echo 'Error on line 531';
                sendErrorEmail($connection->error, E_USER_ERROR, $temp_record_delete_sql);
                trigger_error('Wrong SQL: ' . $temp_record_delete_sql . ' Error: ' . $connection->error, E_USER_ERROR);
            }
            //insert photo information into table
            foreach ($photos_array as $photo) {
                if ($photo['Location'] != '') {
                    $photos_insert_sql = "INSERT INTO `imgsDocs` (`L_ListingID`,`resource`,`type`,`url`,`order`,`import_date`) VALUES (".$mls.",'Property','image','".$photo['Location']."',".$count.",'".$today."')";
                    if($connection->query($photos_insert_sql) === false) {
                        echo 'Error on line 540';
                        sendErrorEmail($connection->error, E_USER_ERROR, $photos_insert_sql);
                        trigger_error('Wrong SQL: ' . $photos_insert_sql . ' Error: ' . $connection->error, E_USER_ERROR);
                    }
                }
                $count++;
            }
        }
    }
}
birchstudio's avatar
birchstudio
asked 2015-06-26 17:26:31 -0500
bwolven's avatar
bwolven
updated 2015-10-30 15:22:06 -0500
edit flag offensive 0 remove flag close merge delete

Comments

David, based on our off-line conversations, I believe this issue has been resolved. If that is the case, can you provide some technical details of how you solved it, if it was code based?

vendorsupport's avatar vendorsupport (2015-07-01 15:23:30 -0500) edit
add a comment see more comments

1 Answer

0

We tracked the problem back to a log file which was being added to during import for debugging. The log file became very large and was slowing down the import process, to the point that it apparently stalled out. Prior to the error, we noticed that the import was taking longer than expected, but we saw no errors being triggered. We turned off the logging and had immediate success.

birchstudio's avatar
birchstudio
answered 2015-07-07 10:29:01 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Login/Signup to Answer