Skip to content

Commit 71ced7d

Browse files
authored
Temporarily add option to enable RemoteRefreshDataStore in DebugPostgres builds (#817)
For testing on https://test.lbpbonsai.com
2 parents e44f2b6 + 341a37b commit 71ced7d

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

Refresh.Core/Storage/DryArchiveConfig.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,9 @@ protected override void Migrate(int oldVer, dynamic oldConfig)
1515
public bool Enabled { get; set; }
1616
public string Location { get; set; } = "/var/dry/";
1717
public bool UseFolderNames { get; set; } = true;
18+
19+
#if DEBUG && POSTGRES
20+
// ReSharper disable once InconsistentNaming
21+
public bool TemporaryWillBeRemoved_UseProductionRefreshData { get; set; } = false;
22+
#endif
1823
}

Refresh.GameServer/RefreshGameServer.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ public RefreshGameServer(
6363

6464
this._dataStore = dataStore;
6565

66+
DryArchiveConfig? dryConfig = null;
6667
try
6768
{
68-
DryArchiveConfig dryConfig = Config.LoadFromJsonFile<DryArchiveConfig>("dry.json", this.Logger);
69+
dryConfig = Config.LoadFromJsonFile<DryArchiveConfig>("dry.json", this.Logger);
6970
if (dryConfig.Enabled)
7071
this._dataStore = new AggregateDataStore(dataStore, new DryDataStore(dryConfig));
7172
}
@@ -95,9 +96,11 @@ public RefreshGameServer(
9596
this._databaseProvider.Initialize();
9697

9798
// Uncomment if you want to use production refresh as a source for assets
98-
#if DEBUG
99-
// this._dataStore = new AggregateDataStore(dataStore, new RemoteRefreshDataStore());
100-
#endif
99+
// TODO: remove config option when test.lbpbonsai.com instance no longer needs prod assets
100+
#if DEBUG && POSTGRES
101+
if (dryConfig?.TemporaryWillBeRemoved_UseProductionRefreshData ?? false)
102+
this._dataStore = new AggregateDataStore(dataStore, new RemoteRefreshDataStore());
103+
#endif
101104

102105
this.SetupInitializer(() =>
103106
{

0 commit comments

Comments
 (0)