Fix Initial Offset (#16375)

* Fix Initial Offset

* Fix Query for postgres
This commit is contained in:
Mohit Yadav 2024-05-22 14:25:11 +05:30 committed by GitHub
parent 3a8d1af4f6
commit f5edf6c760
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -3351,7 +3351,10 @@ public interface CollectionDAO {
"SELECT json FROM change_event ce where ce.offset > :offset ORDER BY ce.eventTime ASC LIMIT :limit")
List<String> list(@Bind("limit") long limit, @Bind("offset") long offset);
@SqlQuery("SELECT count(*) FROM change_event")
@ConnectionAwareSqlQuery(value = "SELECT MAX(offset) FROM change_event", connectionType = MYSQL)
@ConnectionAwareSqlQuery(
value = "SELECT MAX(\"offset\") FROM change_event",
connectionType = POSTGRES)
long getLatestOffset();
}

View File

@ -380,7 +380,7 @@ public abstract class EntityResourceTest<T extends EntityInterface, K extends Cr
// Run webhook related tests randomly. This will ensure these tests are not run for every entity
// evey time junit tests are run to save time. But over the course of development of a release,
// when tests are run enough times, the webhook tests are run for all the entities.
public boolean runWebhookTests = true;
public boolean runWebhookTests = new Random().nextBoolean();
protected boolean supportsSearchIndex = false;