MikaLendingBot icon indicating copy to clipboard operation
MikaLendingBot copied to clipboard

Allow loan history DB name to be configured

Open laxdog opened this issue 7 years ago • 8 comments

Description

Allows multiple bots to run from the same directory, for example in a docker setup.

TESTING STAGE

Testing

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [X] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [X] I have read CONTRIBUTING.md
  • [X] I fully understand Github Flow.
  • [X] My code adheres to the code style of this project.
  • [x] I have updated the documentation in /docs if I have changed the config, arguments, logic in how the bot works, or anything that understandably needs a documentation change.
  • [X] I have updated the config file accordingly if my change requires a new configuration setting or changes an existing one.
  • [ ] I have tested the bot with no issues for 24 continuous hours. If issues were experienced, they have been patched and tested again.

laxdog avatar Dec 05 '17 08:12 laxdog

This doesn't cover all files used by the bot so it won't achieve the goal. For example the plugins files for AccountStats.

rnevet avatar Dec 05 '17 08:12 rnevet

I don't understand. Isn't the only file that's written to the loans_history one @rnevet ?

I can't see any other files in the AccountStats.py

laxdog avatar Dec 05 '17 09:12 laxdog

It is also used for charts plugin. and what about the file for MarketAnalysis?

I'm not sure this approach is maintainable, maybe create a contained output folder?

rnevet avatar Dec 05 '17 09:12 rnevet

The market analysis data is actually best kept as the same file, that means every instance gets access to the data the others are writing. This is how I'm running it currently. That's why I added the exchange prefix to those files.

I can add the market_data folder as well if you want, but this particular file needs to be configurable too.

I see the reference in Charts.py, I'll make that change.

laxdog avatar Dec 05 '17 09:12 laxdog

I suggest we have shared_data , out instance_data folders... which will allow both the required behaviors.. How are you going to sync access the shared_data?

We should think that in the future, we (or other devs) might want to store data that is either shared or instance related... configuring the filename is tedious.

rnevet avatar Dec 05 '17 11:12 rnevet

I feel this is getting overly complicated for a simple change to allow a filename to be configurable. I'll try to get around to it. I'm still in the middle of the FlaskServer and FRR as min branches though.

The access is already synced if you're using the docker-compose file. It mounts the local dir as a volume and then links it into the working dir of the container so you have access to the market data folder.

laxdog avatar Dec 05 '17 13:12 laxdog

I agree, I thought it might be complicated.

rnevet avatar Dec 05 '17 13:12 rnevet

It's going to have to wait until after the flask stuff is finished. There will be too many conflicts that I don't want to have to resolve.

laxdog avatar Dec 05 '17 14:12 laxdog