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

- #73 - implement a few of the missing features #74

Merged
merged 3 commits into from
Apr 29, 2024

Conversation

kirides
Copy link
Contributor

@kirides kirides commented Apr 17, 2024

This PR implements the following features

  • SQLiteWriteOnlyTransaction.AcquireDistributedLock (Transaction.AcquireDistributedLock)
  • HangfireSQLiteConnection.GetSetCount-Limited (Connection.GetSetCount.Limited)
  • HangfireSQLiteConnection.GetSetContains (Connection.GetSetContains)
  • HangfireSQLiteConnection.GetFirstByLowestScoreFromSet (Connection.BatchedGetFirstByLowestScoreFromSet)
  • HangfireSQLiteConnection.GetUtcDateTime (Connection.GetUtcDateTime)

and ignores an ObjectDisposedException when the Heartbeat timer already got disposed while being fired

Feature diff is

{ "Storage.ExtendedApi", false },                            -> true
{ "Job.Queue", true },
{ "Connection.GetUtcDateTime", false },                      -> true
{ "Connection.BatchedGetFirstByLowestScoreFromSet", false }, -> true
{ "Connection.GetSetContains", true },                       -> true, was not implemented before, but marked as true
{ "Connection.GetSetCount.Limited", false },                 -> true
{ "BatchedGetFirstByLowestScoreFromSet", false },            -> true
{ "Transaction.AcquireDistributedLock", true },              -> true, was not implemented before, but marked as true
{ "Transaction.CreateJob", true },                           -> false, is not implemented, we should not advertise it
{ "Transaction.SetJobParameter", true },                     -> false, is not implemented, we should not advertise it
{ "TransactionalAcknowledge:InMemoryFetchedJob", false },
{ "Monitoring.DeletedStateGraphs", false },
{ "Monitoring.AwaitingJobs", false }

Addtionally:

  • introduced SqliteInMemoryTestBase to simplify correct usage of in-memory database
    • as in-memory databases get deleted once their last connection is "closed", we should always ensure that a test keeps the database alive until its finished, no matter how often the newly created connections get closed.
  • improve performance when acquiring connections, by only migrating the tables on the creation of the storage
  • reduced allocations by making use of TState-parameter introduced in TryFewTimesDueToConcurrency
  • replace manual SQLITE_OPEN_URI-constant with SQLitePCL.raw.SQLITE_OPEN_URI

@kirides
Copy link
Contributor Author

kirides commented Apr 19, 2024

@felixclase i added a bit more to this PR while i looked around the code

If that makes the PR too big, feel free to say so and i will rever the additional changes and open another PR if this one gets merged.

@kirides kirides force-pushed the issues/73 branch 2 times, most recently from 0a3181e to 2a9d9d7 Compare April 19, 2024 18:25
kirides added 2 commits April 19, 2024 20:31
- introduced SqliteInMemoryTestBase to simplify correct usage of in-memory database
  - as in-memory databases get deleted once their last connection is "closed", we should always ensure that a test keeps the database alive until its finished, no matter how often the newly created connections get closed.
- improve performance when acquiring connections, by only migrating the tables on the creation of the storage
- reduced allocations by making use of TState-parameter in TryFewTimesDueToConcurrency
- replace manual `SQLITE_OPEN_URI`-constant with `SQLitePCL.raw.SQLITE_OPEN_URI`

Signed-off-by: kirides <[email protected]>
@kirides
Copy link
Contributor Author

kirides commented Apr 19, 2024

please don't mind the force pushes, i mistakenly used the wrong git-information in the previous commits.
The new ones are properly signed-off again

@felixclase felixclase merged commit a51f280 into raisedapp:develop Apr 29, 2024
3 checks passed
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