github::ActivityMonitor method sync_from_github (public)

 <instance of github::ActivityMonitor[i]> sync_from_github

Defined in packages/xowiki/tcl/github-activity-monitor-procs.tcl

An xact-scoped lock stays on the transaction's checked-out DB connection, is shared across threads/processes, and is released automatically on commit, rollback or connection loss.

Testcases:
No testcase defined.
Source code:
::xo::dc transaction {
    set locked [::xo::dc get_value github_sync_lock {
        select case when pg_try_advisory_xact_lock(714230, 1)
                    then 1 else 0 end
    }]
    if {$locked} {
        :sync_locked
    } else {
        ns_log Notice "GitHub: sync skipped; another activity writer is running"
    }
}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: