auth::sync::job::end (public)

 auth::sync::job::end -job_id job_id [ -message message ]

Defined in packages/acs-authentication/tcl/sync-procs.tcl

Record the end of a batch job. Closes out the transaction log and sends out notifications.

Switches:
-job_id (required)
The ID of the batch job you're ending.
-message (optional)
Returns:
array list with result of auth::sync::job::get.
Author:
Lars Pind <lars@collaboraid.biz>
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_sync_actions sync_actions (test acs-authentication) auth::sync::job::end auth::sync::job::end test_sync_actions->auth::sync::job::end test_sync_snapshot sync_snapshot (test acs-authentication) test_sync_snapshot->auth::sync::job::end test_sync_start_end sync_start_end (test acs-authentication) test_sync_start_end->auth::sync::job::end acs_mail_lite::send acs_mail_lite::send (public) auth::sync::job::end->acs_mail_lite::send ad_log ad_log (public) auth::sync::job::end->ad_log ad_system_owner ad_system_owner (public) auth::sync::job::end->ad_system_owner ad_try ad_try (public) auth::sync::job::end->ad_try auth::sync::job::get auth::sync::job::get (public) auth::sync::job::end->auth::sync::job::get auth::authority::batch_sync auth::authority::batch_sync (public) auth::authority::batch_sync->auth::sync::job::end

Testcases:
sync_start_end, sync_actions, sync_snapshot
Source code:
    db_dml update_job_end {}

    # interactive_p, run_time_seconds, num_actions, num_problems
    get -job_id $job_id -array job

    set email_p [parameter::get_from_package_key  -parameter SyncEmailConfirmationP  -package_key "acs-authentication"  -default 0]

    if { ![string is true -strict $job(interactive_p)] && $email_p } {
        # Only send out email if not an interactive job

        ad_try {
            acs_mail_lite::send -send_immediately  -to_addr [ad_system_owner]  -from_addr [ad_system_owner]  -subject "Batch user synchronization for $job(authority_pretty_name) complete"  -body "Batch user synchronization for $job(authority_pretty_name) is complete.

Authority         : $job(authority_pretty_name)
Running time      : $job(run_time_seconds) seconds
Number of actions : $job(num_actions)
Number of problems: $job(num_problems)
Job message       : $job(message)

To view the complete log, please visit\n$job(log_url)"
        } on error {errorMsg} {
            # We don't fail hard here, just log an error
            ad_log Error "Error sending registration confirmation to [ad_system_owner]: $errorMsg"
        }
    }

    return [array get job]
Generic XQL file:
<fullquery name="auth::sync::job::end.update_job_end">
    <querytext>

            update auth_batch_jobs
            set    job_end_time = current_timestamp,
                   message = :message
            where  job_id = :job_id

        </querytext>
</fullquery>
packages/acs-authentication/tcl/sync-procs.xql

PostgreSQL XQL file:
packages/acs-authentication/tcl/sync-procs-postgresql.xql

Oracle XQL file:
packages/acs-authentication/tcl/sync-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: