Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion MergerLogic/Clients/HeartbeatClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ public void Send(object? sender, ElapsedEventArgs elapsedEventArgs)
}
catch (Exception e)
{
// Elapsed runs on a timer thread; the Timer discards anything thrown here and an
// unhandled exception can tear down the process. Log and let the next tick retry.
this._logger.LogError($"[{MethodBase.GetCurrentMethod().Name}] Could not send heartbeat for task={this._taskId}, {e.Message}");
throw;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions MergerLogic/Clients/S3Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@
return null;
}
// In case there are other errors such as connection to S3
throw e;
throw;
}
}

public override Tile? GetTile(int z, int x, int y)
{
string methodName = MethodBase.GetCurrentMethod().Name;

Check warning on line 84 in MergerLogic/Clients/S3Client.cs

View workflow job for this annotation

GitHub Actions / Run Tests (6.0.x)

Dereference of a possibly null reference.
this._logger.LogDebug($"[{methodName}] start z: {z}, x: {x}, y: {y}");
string keyPrefix = this._pathUtils.GetTilePath(this.path, z, x, y, TileFormat.Jpeg, true);

Expand All @@ -102,7 +102,7 @@

public Tile? GetTile(string key)
{
string methodName = MethodBase.GetCurrentMethod().Name;

Check warning on line 105 in MergerLogic/Clients/S3Client.cs

View workflow job for this annotation

GitHub Actions / Run Tests (6.0.x)

Dereference of a possibly null reference.
this._logger.LogDebug($"[{methodName}] start key: {key}");
byte[]? imageBytes = this.GetImageBytes(key);
if (imageBytes == null)
Expand All @@ -117,7 +117,7 @@

public override bool TileExists(int z, int x, int y)
{
string methodName = MethodBase.GetCurrentMethod().Name;

Check warning on line 120 in MergerLogic/Clients/S3Client.cs

View workflow job for this annotation

GitHub Actions / Run Tests (6.0.x)

Dereference of a possibly null reference.
this._logger.LogDebug($"[{methodName}] start z: {z}, x: {x}, y: {y}");
bool exists = this.GetTileKey(z, x, y) != null;
this._logger.LogDebug($"[{methodName}] end z: {z}, x: {x}, y: {y}");
Expand All @@ -126,7 +126,7 @@

public void UpdateTile(Tile tile)
{
string methodName = MethodBase.GetCurrentMethod().Name;

Check warning on line 129 in MergerLogic/Clients/S3Client.cs

View workflow job for this annotation

GitHub Actions / Run Tests (6.0.x)

Dereference of a possibly null reference.
this._logger.LogDebug($"[{methodName}] start {tile.ToString()}");
string key = this._pathUtils.GetTilePath(this.path, tile, true);

Expand All @@ -151,7 +151,7 @@

private string? GetTileKey(int z, int x, int y)
{
string methodName = MethodBase.GetCurrentMethod().Name;

Check warning on line 154 in MergerLogic/Clients/S3Client.cs

View workflow job for this annotation

GitHub Actions / Run Tests (6.0.x)

Dereference of a possibly null reference.
string keyPrefix = this._pathUtils.GetTilePathWithoutExtension(this.path, z, x, y, true);

try
Expand All @@ -169,7 +169,7 @@
return null;
}
// In case there are other errors such as connection to S3
throw e;
throw;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion MergerLogic/DataTypes/Fs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class FS : Data<IFileClient>
private IFileSystem _fileSystem;

private readonly string[] _supportedFileExtensions = { ".png", ".jpg", ".jpeg" };
static readonly object _locker = new object();
private readonly object _locker = new object();

public FS(IPathUtils pathUtils, IServiceProvider container, string path, int batchSize, Grid? grid, GridOrigin? origin, bool isBase = false)
: base(container, DataType.FOLDER, path, batchSize, grid, origin, isBase)
Expand Down
2 changes: 1 addition & 1 deletion MergerLogic/DataTypes/Gpkg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Gpkg : Data<IGpkgClient>
private long _offset;
private Extent _extent;
private readonly IConfigurationManager _configManager;
static readonly object _locker = new object();
private readonly object _locker = new object();

public Gpkg(IConfigurationManager configuration, IServiceProvider container,
string path, int batchSize, Grid? grid, GridOrigin? origin, bool isBase = false, Extent? extent = null)
Expand Down
2 changes: 1 addition & 1 deletion MergerLogic/DataTypes/S3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class S3 : Data<IS3Client>
private IEnumerator<int> _zoomEnumerator;
private string? _continuationToken;
private bool _endOfRead;
static readonly object _locker = new object();
private readonly object _locker = new object();
private const string nullStringValue = "Null";

private readonly IPathUtils _pathUtils;
Expand Down
8 changes: 2 additions & 6 deletions MergerLogic/Utils/ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,8 @@ public ConfigurationManager(ILogger<ConfigurationManager>? logger)

public IEnumerable<IConfigurationSection> GetChildren(params string[] configPath)
{
var config = this.config.GetSection(configPath[0]);
for (int i = 1; i < configPath.Length - 1; i++)
{
config = this.config.GetSection(configPath[i]);
}
return config.GetSection(configPath[configPath.Length - 1]).GetChildren();
string key = string.Join(":", configPath);
return this.config.GetSection(key).GetChildren();
}

public string GetConfiguration(params string[] configPath)
Expand Down
Loading