go-co-op / gocron-gorm-lock

A gocron locker implementation using gorm
MIT License
9 stars 5 forks source link

adding basic gocron-gorm-lock functionality. #1

Closed manuelarte closed 1 year ago

manuelarte commented 1 year ago

What does this do?

Which issue(s) does this PR fix/relate to?

Adding basic gocron-gorm lock functionality. It should be described in the Readme file.

Important topic to discuss:

List any changes that modify/break current functionality

Have you included tests for your changes?

I added a test following the convention in gocron-redis-lock, I also added an extra test that checks the uniqueness of the job name + timestamp in the database.

Did you document any new/modified functionality?

Notes

Any feedback is appreciated.

github-advanced-security[bot] commented 1 year ago

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

JohnRoesler commented 1 year ago

@manuelarte thanks for your desire to contribute to the open source! See my comments on the design below. Great work!

rfyiamcool commented 1 year ago

👍

manuelarte commented 1 year ago

I updated the PR

JohnRoesler commented 1 year ago

Looks like the test is failing

manuelarte commented 1 year ago

Looks like the test is failing

yes. This is a problem I discovered some time ago. The miliseconds precision (the one I put by default), gives problems since the operation to lock and unlock sometimes takes quite some time. I decided to change the precision to seconds, and change the tests accordingly.

manuelarte commented 1 year ago

I forgot to update one part of one test

manuelarte commented 1 year ago

@JohnRoesler could you run the workflows again?

manuelarte commented 1 year ago

is something else missing?