put default config if no config.json found

refactor Constants
This commit is contained in:
Alex Bezdieniezhnykh
2025-06-30 20:06:02 +03:00
parent 6eeb6d20bf
commit bb6413c4f0
10 changed files with 191 additions and 174 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ public class AzaionApi(ILogger logger, HttpClient client, ICache cache, ApiCrede
{
get
{
var user = cache.GetFromCache(SecurityConstants.CURRENT_USER_CACHE_KEY,
var user = cache.GetFromCache(Constants.CURRENT_USER_CACHE_KEY,
() => Get<User>("currentUser"));
if (user == null)
throw new Exception("Can't get current user");
+1 -1
View File
@@ -40,7 +40,7 @@ public class GpsMatcherService(IGpsMatcherClient gpsMatcherClient,
public async Task RunGpsMatching(string userRouteDir, GeoPoint initGeoPoint, CancellationToken detectToken = default)
{
_routeDir = Path.Combine(SecurityConstants.EXTERNAL_GPS_DENIED_FOLDER, _dirConfig.GpsRouteDirectory);
_routeDir = Path.Combine(Constants.EXTERNAL_GPS_DENIED_FOLDER, _dirConfig.GpsRouteDirectory);
_userRouteDir = userRouteDir;
_allRouteImages = Directory.GetFiles(userRouteDir)
+2 -2
View File
@@ -49,9 +49,9 @@ public class GpsMatcherClient : IGpsMatcherClient
using var process = new Process();
process.StartInfo = new ProcessStartInfo
{
FileName = SecurityConstants.ExternalGpsDeniedPath,
FileName = Constants.ExternalGpsDeniedPath,
Arguments = $"zeromq --rep {gpsConfig.Value.ZeroMqPort} --pub {gpsConfig.Value.ZeroMqReceiverPort}",
WorkingDirectory = SecurityConstants.EXTERNAL_GPS_DENIED_FOLDER,
WorkingDirectory = Constants.EXTERNAL_GPS_DENIED_FOLDER,
CreateNoWindow = true
};
process.Start();
+1 -1
View File
@@ -45,7 +45,7 @@ public class InferenceClient : IInferenceClient
using var process = new Process();
process.StartInfo = new ProcessStartInfo
{
FileName = SecurityConstants.EXTERNAL_INFERENCE_PATH,
FileName = Constants.EXTERNAL_INFERENCE_PATH,
Arguments = $"-p {_inferenceClientConfig.ZeroMqPort} -lp {_loaderClientConfig.ZeroMqPort} -a {_inferenceClientConfig.ApiUrl}",
CreateNoWindow = true
};
+1 -1
View File
@@ -22,7 +22,7 @@ public class LoaderClient(LoaderClientConfig config, ILogger logger, Cancellatio
using var process = new Process();
process.StartInfo = new ProcessStartInfo
{
FileName = SecurityConstants.EXTERNAL_LOADER_PATH,
FileName = Constants.EXTERNAL_LOADER_PATH,
Arguments = $"--port {config.ZeroMqPort} --api {config.ApiUrl}",
CreateNoWindow = true
};
@@ -43,7 +43,7 @@ public class SatelliteDownloader(
private const int OUTPUT_TILE_SIZE = 512;
private readonly string _apiKey = mapConfig.Value.ApiKey;
private readonly string _satDirectory = Path.Combine(SecurityConstants.EXTERNAL_GPS_DENIED_FOLDER, directoriesConfig.Value.GpsSatDirectory);
private readonly string _satDirectory = Path.Combine(Constants.EXTERNAL_GPS_DENIED_FOLDER, directoriesConfig.Value.GpsSatDirectory);
public async Task GetTiles(GeoPoint centerGeoPoint, double radiusM, int zoomLevel, CancellationToken token = default)
{