sthewissen / Mynt

An Azure Functions-based crypto currency trading bot; featuring 10 exchanges, 25 indicators, custom strategy support, backtester and more
BSD 3-Clause "New" or "Revised" License
237 stars 129 forks source link

SQL Server not entirely working as planned #57

Closed sthewissen closed 6 years ago

sthewissen commented 6 years ago

Got the following from a user:

SqlServerData cannot use the native login, and the account password must be required. There will be bugs using SqlServerData. Maybe the reason why I run locally?

Need to check up on the SQL server side of things, because I don't use it myself.

kitcoun commented 6 years ago

Thank you for adding Huobi. Errors in SqlServer and Sqlite.

The reason: OnModelCreating creates a model context that is instantiated only once, but OnConfiguring is called once every instantiation of a context.

The solution: image

sthewissen commented 6 years ago

I may be wrong but isn't the commented out code doing the same as the new line of code?

sthewissen commented 6 years ago

Just ran on SQL Server, can't say that I had something weird happen to me? Looks to be working from my end. Would love to hear more about what doesn't work for people struck by this issue :)

kitcoun commented 6 years ago

It's my fault。

An attempt was made to use the context while it is being configured. A DbContext instance cannot be used inside OnConfiguring since it is still being configured at this point. This can happen if a second operation is started on this context before a previous operation completed. Any instance members are not guaranteed to be thread safe

It is possible to happen an error when an orders is added

https://docs.microsoft.com/en-us/ef/core/miscellaneous/configuring-dbcontext


There is an error in the GetExtendedMarketSummaries

error:The operation has timed out.

It should be access too fast.

sthewissen commented 6 years ago

If the SQL server side of things works for you I am closing this. Please create a new issue if you have any other problems :)