Changeset 16736

Show
Ignore:
Timestamp:
06/29/08 11:12:10 (2 months ago)
Author:
rambo
Message:

forward port r16735

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.helper.replicator/exporter/staging2live.php

    r16426 r16736  
    113113        // FIXME: use strtotime when MidCOM stops automagically rewriting these between ISO and Unix timestamps 
    114114        $schedule_action = 'ok'; 
    115         $schedulestart_unixtime = $object->metadata->schedulestart; 
    116         $scheduleend_unixtime = $object->metadata->scheduleend; 
     115        if (!preg_match('%[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}%', $object->metadata->schedulestart)) 
     116        { 
     117            $schedulestart_unixtime = strtotime($object->metadata->schedulestart); 
     118        } 
     119        else 
     120        { 
     121            $schedulestart_unixtime = $object->metadata->schedulestart; 
     122        } 
     123        if (!preg_match('%[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}%', $object->metadata->scheduleend)) 
     124        { 
     125            $scheduleend_unixtime = strtotime($object->metadata->scheduleend); 
     126        } 
     127        else 
     128        { 
     129            $scheduleend_unixtime = $object->metadata->scheduleend; 
     130        } 
    117131        if ($schedulestart_unixtime) 
    118132        { 
  • trunk/midcom/midcom.helper.replicator/queuemanager.php

    r16430 r16736  
    634634            $GLOBALS['midcom_helper_replicator_logger']->log("Saving queue for later retry.", MIDCOM_LOG_ERROR); 
    635635            debug_pop(); 
    636             return; 
     636            // this is not a fatal error, return true 
     637            return true; 
    637638        } 
    638639 
  • trunk/midcom/midcom.helper.replicator/transporter/http.php

    r16087 r16736  
    155155    function _real_process(&$items, $retry_count = 0) 
    156156    { 
     157        $orig_items_count = count($items); 
    157158        foreach ($items as $key => $data) 
    158159        { 
     
    190191        } 
    191192 
     193        $remaining_items_count = count($items); 
     194        if (   !empty($remaining_items_count) 
     195            && $orig_items_count === $remaining_items_count) 
     196        { 
     197            // All items failed send (likely unavailable target server), return false to retry in stead of quarantine 
     198            debug_push_class(__CLASS__, __FUNCTION__); 
     199            debug_add("\$remaining_items_count(={$remaining_items_count}) is the same as \$orig_items_count(={$orig_items_count}), all keys failed, marking for retry in stead on quarantine", MIDCOM_LOG_INFO); 
     200            debug_pop(); 
     201            $this->error = 'send failed for all keys'; 
     202            return false; 
     203        } 
    192204        return true; 
    193205    }