本文整理汇总了C++中Email::sendHold方法的典型用法代码示例。如果您正苦于以下问题:C++ Email::sendHold方法的具体用法?C++ Email::sendHold怎么用?C++ Email::sendHold使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Email
的用法示例。
在下文中一共展示了Email::sendHold方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
BaseShadow::emailHoldEvent( const char* reason )
{
Email mailer;
mailer.sendHold( jobAd, reason );
}
示例2: if
//.........这里部分代码省略.........
// NOTE: The local universe's log actions are not consistent
// with what the Shadow does. This is because the Shadow is
// not consistent with itself; for example, a condor_rm
// will cause an EVICT notice in the user log, but a
// periodic remove will not. This is something Derek
// said he will clean up later on. For now, however, we are
// going to be consistent with ourself in the local universe
// and ALWAYS send an eviction notice when the job is
// removed
this->u_log->logEvict( this->job_ad, false );
did_ulog_event = true;
break;
default:
EXCEPT("Internal error in JICLocalSchedd::notifyJobExit: unexpected exit code %d",this->exit_code);
}
}
if( !did_schedd_update ) {
// Use the final exit code to determine the update type.
// This may be different from what is indicated by 'reason',
// because a policy expression evaluted by checkAtExit() may
// have changed things.
update_t up_type = U_TERMINATE;
switch( this->exit_code ) {
case JOB_EXITED:
up_type = U_TERMINATE;
break;
case JOB_SHOULD_REQUEUE:
up_type = U_REQUEUE;
break;
case JOB_SHOULD_REMOVE:
up_type = U_REMOVE;
break;
case JOB_SHOULD_HOLD:
case JOB_MISSED_DEFERRAL_TIME:
up_type = U_HOLD;
break;
default:
EXCEPT("Internal error in JICLocalSchedd::notifyJobExit: unexpected exit code %d",this->exit_code);
}
// Now that we've logged the event, we can update the job queue
// If we're doing a fast shutdown, don't retry on failure.
if ( !this->job_updater->updateJob( up_type ) && !fast_exit ) {
dprintf( D_ALWAYS,
"Failed to update job queue - attempting to retry.\n" );
retryJobCleanup();
return ( false );
}
did_schedd_update = true;
}
//
// Once the job's been updated in the queue, we can also try
// sending email notification, if desired.
// This returns void, so there's no way to test for failure.
// Therefore, we don't bother with retry.
//
Email msg;
switch( this->exit_code ) {
case JOB_SHOULD_REQUEUE:
case JOB_EXITED:
msg.sendExit( job_ad, reason );
break;
case JOB_SHOULD_REMOVE: {
char *remove_reason = NULL;
this->job_ad->LookupString( ATTR_REMOVE_REASON, &remove_reason );
msg.sendRemove( this->job_ad, remove_reason ? remove_reason : "" );
free( remove_reason );
break;
}
case JOB_SHOULD_HOLD: {
char *hold_reason = NULL;
this->job_ad->LookupString( ATTR_HOLD_REASON, &hold_reason );
msg.sendHold( this->job_ad, hold_reason ? hold_reason : "" );
free( hold_reason );
break;
}
case JOB_MISSED_DEFERRAL_TIME:
msg.sendHold( this->job_ad, "missed derreral time" );
break;
default:
EXCEPT("Internal error in JICLocalSchedd::notifyJobExit: unexpected exit code %d",this->exit_code);
}
//
// Lastly, we will call to write out the file. This was
// originally done in JICLocal::notifyJobExit(), but we no
// longer call that
//
this->writeOutputAdFile( this->job_ad );
//
// Once we get here, everything has been successfully
// wrapped up.
//
return true;
}