Provide an option to skip navigation menu creation in the create domain API call, since it seems prone to deadlock
I have found the _civicrm_load_navigation()
call within the civicrm_api3_multisite_domain_create()
API call prone to deadlock, causing the API call to hang and ultimately fail.
As a workaround, I've added optional skip_nav
parameter. When true (or truthy), the _civicrm_load_navigation()
call is skipped.
With this in place, I can create a new domain without error by:
- Call
civicrm_api3_multisite_domain_create()
including$params['skip_nav'] = 1
. The API call succeeds. - Call
civicrm_api3_multisite_domain_create()
with the same parameters as step 1, except omitting$params['skip_nav']
(or with$params['skip_nav'] = 0
). Since the domain already exists, it is not recreated. And on this second API call, the_civicrm_load_navigation()
does not ever seem to deadlock, so the navigation records for the new domain are successfully created.
I've combined this with the suggested fix to #7 (closed) and will submit a merge request for this.