mirror of
https://github.com/azaion/annotations.git
synced 2026-04-23 02:06:30 +00:00
put default config if no config.json found
refactor Constants
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user