Skip to content

Widen search for new meetings #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions os2web_esdh_provider.module
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,12 @@ function os2web_esdh_provider_cron() {
if ($queue->numberOfItems() == 0) {

$current_timestamp = time();
$last_mm_import_time = variable_get('os2web_esdh_provider_last_mm_import', FALSE);

// In some cases the filecopy service will preserve the timestamps on the
// files. This will cause the meeting to be skipped during import.
// Since the import it self skips meetings already imported, we just
// subtract an hour, in order to get all new meetings.
$last_mm_import_time = variable_get('os2web_esdh_provider_last_mm_import', FALSE) - 3600;

foreach ($meetings as $meeting) {
// Only import files newer than last cron job.
Expand All @@ -208,7 +213,11 @@ function os2web_esdh_provider_queue_meetings() {
if (os2web_esdh_provider_has_api('mm')) {
$meetings = os2web_esdh_provider_invoke('mm', 'get_import_list');

$last_mm_import_time = variable_get('os2web_esdh_provider_last_mm_import', FALSE);
// In some cases the filecopy service will preserve the timestamps on the
// files. This will cause the meeting to be skipped during import.
// Since the import it self skips meetings already imported, we just
// subtract an hour, in order to get all new meetings.
$last_mm_import_time = variable_get('os2web_esdh_provider_last_mm_import', FALSE) - 3600;

$queue = DrupalQueue::get('acadre_mm_import');

Expand All @@ -219,8 +228,6 @@ function os2web_esdh_provider_queue_meetings() {
}
}
$queue->createItem(array('post_import_process' => TRUE));
variable_set('os2web_esdh_provider_last_mm_import', $current_timestamp);

variable_set('os2web_esdh_provider_last_mm_import', time());
}
}
Expand Down