Skip to content
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

[SERVICES-2669] Cron job for triggering analytics indexing #1517

Open
wants to merge 3 commits into
base: SERVICES-2668-rest-endpoints-for-managing-indexing
Choose a base branch
from

Conversation

mad2sm0key
Copy link
Contributor

@mad2sm0key mad2sm0key commented Oct 23, 2024

Reasoning

  • Provide a mechanism that triggers ES events processing and advances the state on indexing sessions PR#1516

Proposed Changes

  • add cron job that fetches active sessions from mongoDB and initiates processing; advances state on indexing sessions stored in mongoDB

How to test

  • the cronjob should populate timescaleDB hyper_dex_analytics table with data and advance the state of an indexing session

@mad2sm0key mad2sm0key marked this pull request as ready for review October 24, 2024 06:57
- add default scroll timeout of '5m' to prevent failure

await this.indexerPersistence.updateSession(session);
} catch (error) {
await this.markSessionFailed(session);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would also save the error somewhere to be easier to debug. Or log it here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


return job;
} catch (error) {
job.runAttempts += 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

return job;
} catch (error) {
job.runAttempts += 1;
console.log('EXTRA ATTEMPT', job.runAttempts);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log with OriginLogger

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants