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

feat: add with_ttl option #6

Merged
merged 4 commits into from
Dec 7, 2023

Conversation

rfyiamcool
Copy link
Contributor

summay

clean old records. 😁 avoid excessive data in mysql.

@rfyiamcool rfyiamcool changed the title feat: add with_ttl option, clean due record in mysql feat: add with_ttl option Nov 16, 2023
if db == nil {
return nil, fmt.Errorf("gorm db definition can't be null")
}
if worker == "" {
return nil, fmt.Errorf("worker name can't be null")
}
gl := &gormLocker{db: db, worker: worker}

gl := &GormLocker{
Copy link
Collaborator

Choose a reason for hiding this comment

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

any reason why are we now making public gormlocker?

Copy link
Contributor Author

@rfyiamcool rfyiamcool Dec 7, 2023

Choose a reason for hiding this comment

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

any reason why are we now making public gormlocker?

golang lint throw error. 😅

// Warning: unexported-return: exported func NewGormLocker returns unexported type *gormlock.gormLocker, which can be annoying to use (revive)

func NewGormLocker(db *gorm.DB, worker string, options ...LockOption) (*gormLocker, error) {
...
}

Signed-off-by: rfyiamcool <[email protected]>
Signed-off-by: rfyiamcool <[email protected]>
Signed-off-by: rfyiamcool <[email protected]>
@manuelarte manuelarte merged commit 1624a92 into go-co-op:main Dec 7, 2023
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.

3 participants