public async Task ExportLiveTradesData() { if (Config.Data.SaveHistoricalTradesData) { Logger.Debug("Exporting trades data"); var tradesString = TradeUtil.GetTradesString(); if (tradesString == null || tradesString.Length == 0) { return; } try { Logger.Debug("Saving trades to file"); await DataExporter.AddToFile("trades", "/", tradesString); } catch (Exception e) { Logger.Error($"Got an exception trying to export trades data: \n {e}"); } Logger.Debug("Finished exporting trades data"); } }
private async Task ExportLiveStoreData(bool byCommand = false) { if (Config.Data.SaveStoreData) { // Overrides current store data in file Logger.Debug("Exporting store data"); var storesString = TradeUtil.GetStoresString(); if (storesString == null || storesString.Length == 0) { return; } await DataExporter.WriteToFile("stores", "/", storesString[0]); Logger.Debug($"Store data exported at {DateTime.Now.ToShortTimeString()}"); if (!byCommand && Config.Data.SaveHistoricalStoreData) { Logger.Debug("Saving stores data to history file"); await DataExporter.AddToFile("storesHistoric", "/", storesString[1]); } Logger.Debug("Finished UpdateStoreData"); } }