elastic / connectors-ruby

Official Connector Clients for Elastic Elasticsearch, Enterprise Search, App Search and Workplace Search
https://www.elastic.co/guide/en/enterprise-search/master/index.html
Other
9 stars 17 forks source link

Fix the bug that connector starts sync immediately when scheduled #531

Closed wangch079 closed 1 year ago

wangch079 commented 1 year ago

Closes https://github.com/elastic/enterprise-search-team/issues/3366

The connector will start syncing immediately if its scheduling is enabled and it's never synced.

This PR fixes this bug, and makes the job scheduling respect the crontab:

It gets the next sync time from now, and compares it with now + poll_interval. It will trigger the sync if the next sync time happens before the next poll. This is consistent with the python implementation.

A follow-up PR to update ent-search gem: https://github.com/elastic/ent-search/pull/7322

Checklists

Pre-Review Checklist

github-actions[bot] commented 1 year ago

💔 Failed to create backport PR(s)

The backport operation could not be completed due to the following error: There are no branches to backport to. Aborting.

The backport PRs will be merged automatically after passing CI.

To backport manually run: backport --pr 531 --autoMerge --autoMergeMethod squash

wangch079 commented 1 year ago

💚 All backports created successfully

Status Branch Result
✅ 8.7

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation