forked from Project60/org.project60.banking
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
65 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/*-------------------------------------------------------+ | ||
| Project 60 - CiviBanking | | ||
| Copyright (C) 2013-2014 SYSTOPIA | | ||
| Author: B. Endres (endres -at- systopia.de) | | ||
| http://www.systopia.de/ | | ||
+--------------------------------------------------------+ | ||
| This program is released as free software under the | | ||
| Affero GPL license. You can redistribute it and/or | | ||
| modify it under the terms of this license which you | | ||
| can read by viewing the included agpl.txt or online | | ||
| at www.gnu.org/licenses/agpl.html. Removal of this | | ||
| copyright header is strictly prohibited without | | ||
| written permission from the original author(s). | | ||
+--------------------------------------------------------*/ | ||
|
||
/** | ||
* Get a batching lock | ||
* | ||
* the lock is needed so that only one relevant process can access the | ||
* payment/statment data structures at a time | ||
* | ||
* @return lock object. check if it ->isAcquired() before use | ||
*/ | ||
function banking_helper_getLock($type, $id) { | ||
if ($type=='tx') { | ||
$timeout = 7.0; // TODO: do we need a setting here? | ||
return new CRM_Core_Lock('org.project60.banking.tx'.'-'.$id, $timeout); | ||
} elseif ($type=='txbatch') { | ||
$timeout = 600.0; // 10mins, TODO: do we need a setting here? | ||
return new CRM_Core_Lock('org.project60.banking.txbatch'.'-'.$id, $timeout); | ||
} else { | ||
error_log("org.project60.banking - Lock of type '$type' not known."); | ||
return NULL; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters