Skip to content

Commit 4877df6

Browse files
committed
Merge branch 'lockFileMode'
[#49] Use "w+" mode for opening/creating the unoconv lock file
2 parents 9def6aa + bfdd1cf commit 4877df6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CRM/Civioffice/DocumentRendererType/LocalUnoconv.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ protected function lock()
605605
{
606606
$lock_file_path = $this->unoconv_lock_file_path;
607607
if ($lock_file_path) {
608-
$this->unoconv_lock_file = fopen($lock_file_path, "r+");
608+
$this->unoconv_lock_file = fopen($lock_file_path, "w+");
609609
if (!flock($this->unoconv_lock_file, LOCK_EX)) {
610610
throw new Exception(E::ts("CiviOffice: Could not acquire unoconv lock."));
611611
}

templates/CRM/Civioffice/Form/DocumentRenderer/Settings/LocalUnoconv.tpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</div>
2323

2424
<div class="crm-section">
25-
<div class="help">{ts}We strongly recommend creating a system-wide lock file on this server to synchronise access. (It may only run one unoconv process at the same time.) You can create such a file doing this in the server console:<br><code>touch /some/accessible/path/unoconv.lock && chmod 777 /some/accessible/path/unoconv.lock</code><br>Please note: This path needs to be equal in every civicrm environment on this server. Otherwise, locking is only active for this very civicrm instance!{/ts}</div>
25+
<div class="help">{ts}We strongly recommend creating a system-wide lock file on this server to synchronise access. (It may only run one unoconv process at the same time.) Such a file is created automatically at the location shown below. Please note: This path needs to be equal in every civicrm environment on this server. Otherwise, locking is only active for this very civicrm instance!{/ts}</div>
2626
<div class="label">{$form.unoconv_lock_file_path.label}</div>
2727
<div class="content">{$form.unoconv_lock_file_path.html}</div>
2828
<div class="clear"></div>

0 commit comments

Comments
 (0)