zeromicro / go-zero

A cloud-native Go microservices framework with cli tool for productivity.
https://go-zero.dev
MIT License
29.15k stars 3.94k forks source link

The breaker attribute of the mongo package is not open to the public #3581

Open lidaqi001 opened 1 year ago

lidaqi001 commented 1 year ago
       // Model is a mongodb store model that represents a collection.
    Model struct {
        Collection
        name string
        cli  *mongo.Client
        brk  breaker.Breaker // change to option
        opts []Option
    }

I need to allow for some errors, such as those triggered by unique indexes

I want to make 'brk' an option, (I can try to modify it)

What I want to ask is, if I change this, will it be merged into master branch?

kevwan commented 1 year ago

Duplicate of #3580

lidaqi001 commented 1 year ago

api/rpc services can customize breaker, why not databases?

kevwan commented 1 year ago

I think it might be a good idea to add WithoutBreaker() option to NewMysql().

github-actions[bot] commented 2 days ago

This issue is stale because it has been open for 30 days with no activity.