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

the lastChecked date for Biosecurity Alerts is used properly #357

Open
qifeng-bai opened this issue Jan 15, 2025 · 1 comment
Open

the lastChecked date for Biosecurity Alerts is used properly #357

qifeng-bai opened this issue Jan 15, 2025 · 1 comment
Assignees

Comments

@qifeng-bai
Copy link
Contributor

qifeng-bai commented Jan 15, 2025

If the lastChecked date is not updated, Biosecurity will search for records within a 7-day time window, which works fine in most cases.

However, if the scheduled task is paused and then resumed after a few weeks, the alerts will not return results from the last checked date.

Problem 2:
When we click 'preview', the record should not be saved into DB
Reason:
userService was defined as Transactional
def user = userService.getUserByEmail(alaUser?.email)

@qifeng-bai qifeng-bai self-assigned this Jan 15, 2025
@qifeng-bai
Copy link
Contributor Author

qifeng-bai commented Jan 15, 2025

The method used to get the last checked date only works for Biosecurity alerts.

    def getLastCheckedDate(Query query) {
        def lastCheckedDate = null
        def queryResult = QueryResult.findByQuery(query)
        if (queryResult) {
            lastCheckedDate = queryResult.lastChecked
        }
        lastCheckedDate
    }

The other alerts may have 4 last checked date from hourly, monthly, daily, weekly subscribers

@qifeng-bai qifeng-bai changed the title the lastChecked date for Biosecurity Alerts is not updated in DB the lastChecked date for Biosecurity Alerts is used properly Jan 16, 2025
qifeng-bai added a commit that referenced this issue Jan 16, 2025
And the preview data was unexpectedly stored in the database.
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

When branches are created from issues, their pull requests are automatically linked.

1 participant