mongoose-sequence icon indicating copy to clipboard operation
mongoose-sequence copied to clipboard

Scoped singleton archive

Open chumager opened this issue 7 years ago • 6 comments

Hi, thanks for the module, I've an issue regarding to differents DB with the same sequence.

Reading your code I could check your archive lib is defined at the beginning of your code, instead of do it in the getInstance method so if you have two DB with the same sequence it return error.

Can you fix it please? It's just move the definition fron the top to inside the getInstance method.

Thanks in advance

chumager avatar Feb 28 '19 11:02 chumager

Sorry, my linter does not check on modules, it's a little more...

chumager avatar Feb 28 '19 11:02 chumager

I'm not sure I get it. Tell me if you still have any problem and I'll try to help you.

ramiel avatar Mar 09 '19 00:03 ramiel

Hi, I'd to fork your module... if you use a singleton to avoid sequence names repetition then you can't use the same sequence in 2 different DB... and I use your module in 2 cloned DB, to avoid problems with de DBs I used a Map yo define the scope.

I've never made a pull request, if You want I can see how and send you my modifications.

Best regards.

chumager avatar Mar 14 '19 15:03 chumager

I'm having the same issue, I'm returning multiple connections to the same database and each one of them try to register counters and crash. Require a scoped sequence_archive to fix this issue!

Rfrixy avatar Nov 18 '19 12:11 Rfrixy

I already fixed it with a map with the connection as the key, tell me if you need it

Regards

chumager avatar Nov 18 '19 21:11 chumager

Please, feel free to send a PR

ramiel avatar Nov 21 '19 08:11 ramiel