This repository has been archived by the owner on Jul 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OYPD-556] Update openy_group_schedules from Houston YMCA. (#728)
* [OYPD-556] Update openy_group_schedules from Houston YMCA. * [OYPD-556] Fix issues & bring changes more inline with Houston, attempting to resolve anonymous user errors. * [OYPD-556] Resolve wrong option ids for groupex form. * [OYPD-556] Resolve class selection overwriting from previous value. * [OYPD-556] Update groupex pro paragraph behat test after updates. * [OYPD-556] Fix instructor query & date styles. * [OYPD-556] Remove schedules date select cache, and include instructor from query param when no user input is provided. * [OYPD-556] Sync js Drupal.openy_group_schedules.update_class_select from houstonY. * [OYPD-556] Add Drupal.openy_group_schedules.update_instructor_select to update instructor on after ajax links. * [OYPD-556] Clean instructor option keys per instruction. * [OYPD-556] Resolve date and instructor field setting, add submit.
- Loading branch information
1 parent
9f6e483
commit b5b8595
Showing
14 changed files
with
308 additions
and
70 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
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
46 changes: 46 additions & 0 deletions
46
modules/custom/openy_group_schedules/modules/groupex_form_cache/groupex_form_cache.module
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,46 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Module file. | ||
*/ | ||
|
||
/** | ||
* Run Groupex Form cache warmer. | ||
* | ||
* @param int $lock_lifetime | ||
* Lock lifetime. 7 hours by default. | ||
*/ | ||
function groupex_form_cache_warm($lock_lifetime = 25200) { | ||
$lock_name = "groupex_form_cache_warmer"; | ||
|
||
// 7 hours of lock lifetime. | ||
$lock = \Drupal::lock(); | ||
if ($lock->acquire($lock_name, $lock_lifetime)) { | ||
\Drupal::service('groupex_form_cache.warmer')->warm(); | ||
$lock->release($lock_name); | ||
} | ||
else { | ||
$msg = 'Lock "%name" is still working. Exit.'; | ||
Drupal::logger('groupex_form_cache')->info( | ||
$msg, | ||
[ | ||
'%name' => $lock_name, | ||
] | ||
); | ||
} | ||
} | ||
|
||
/** | ||
* Reset all GroupEx form cache. | ||
*/ | ||
function groupex_form_cache_reset_all() { | ||
\Drupal::service("groupex_form_cache.manager")->resetCache(100); | ||
} | ||
|
||
/** | ||
* Quick Groupex cache reset (using TRUNCATE). | ||
*/ | ||
function groupex_form_cache_reset_all_quick() { | ||
\Drupal::service("groupex_form_cache.manager")->quickResetCache(); | ||
} |
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
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
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
Oops, something went wrong.