<commit_before><?php
/**
 * Process incoming payment notifications for a time period.
 *
 * Note that Omnipay payment processors will use the functionality in Omnipay.
 *
 * @param array $params
 *
 * @return array
 *   API result array
 * @throws \API_Exception
 * @throws \CiviCRM_API3_Exception
 */
function civicrm_api3_notification_log_process($params) {
  $logs = civicrm_api3('SystemLog', 'get', array('timestamp' => array('BETWEEN' => array($params['start_time'], $params['end_time']))));
  foreach ($logs['values'] as $id => $values) {
    try {
      civicrm_api3('NotificationLog', 'retry', array('system_log_id' => $values['id']));
    }
    catch (CiviCRM_API3_Exception $e) {
      if ($e->getMessage() == 'DB Error: already exists') {
        $logs['values'][$id]['already_processed'] = TRUE;
      }
      else {
        throw new CiviCRM_API3_Exception($e->getMessage());
      }
    }
  }
  return civicrm_api3_create_success($logs['values'], $params, 'NotificationLog', 'process');
}


/**
 * Specifications for retrying a transaction.
 *
 * @param array $params
 */
function _civicrm_api3_notification_log_process_spec(&$params) {
  $params['start_time']['api.default'] = '-24 hours';
  $params['start_time']['title'] = ts('Start Time');
  $params['start_time']['type'] = CRM_Utils_Type::T_DATE;
  $params['end_time']['api.default'] = 'now';
  $params['end_time']['title'] = ts('End Time');
  $params['end_time']['type'] = CRM_Utils_Type::T_DATE;
}<commit_msg>fix process job time-date field etadata<commit_after><?php
/**
 * Process incoming payment notifications for a time period.
 *
 * Note that Omnipay payment processors will use the functionality in Omnipay.
 *
 * @param array $params
 *
 * @return array
 *   API result array
 * @throws \API_Exception
 * @throws \CiviCRM_API3_Exception
 */
function civicrm_api3_notification_log_process($params) {
  $logs = civicrm_api3('SystemLog', 'get', array('timestamp' => array('BETWEEN' => array($params['start_time'], $params['end_time']))));
  foreach ($logs['values'] as $id => $values) {
    try {
      civicrm_api3('NotificationLog', 'retry', array('system_log_id' => $values['id']));
    }
    catch (CiviCRM_API3_Exception $e) {
      if ($e->getMessage() == 'DB Error: already exists') {
        $logs['values'][$id]['already_processed'] = TRUE;
      }
      else {
        throw new CiviCRM_API3_Exception($e->getMessage());
      }
    }
  }
  return civicrm_api3_create_success($logs['values'], $params, 'NotificationLog', 'process');
}


/**
 * Specifications for retrying a transaction.
 *
 * @param array $params
 */
function _civicrm_api3_notification_log_process_spec(&$params) {
  $params['start_time']['api.default'] = '-24 hours';
  $params['start_time']['title'] = ts('Start Time');
  $params['start_time']['type'] = CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME;
  $params['end_time']['api.default'] = 'now';
  $params['end_time']['title'] = ts('End Time');
  $params['end_time']['type'] = CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME;
}
{'fraction_non_alphanumeric': 0.17753623188405798, 'fraction_numerical': 0.006587615283267457, 'mean_word_length': 4.851637764932563, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1666866', 'n_tokens_mistral': 1017, 'n_tokens_neox': 1001, 'n_words': 199}