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
21 changes: 7 additions & 14 deletions PluginSnowflake/API/Replication/WriteRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ namespace PluginSnowflake.API.Replication
{
public static partial class Replication
{
private static readonly SemaphoreSlim ReplicationSemaphoreSlim = new SemaphoreSlim(1, 1);
private static readonly SemaphoreSlim ReplicationSemaphoreSlim = new SemaphoreSlim(10, 10);

/// <summary>
/// Adds and removes records to replication db
/// Adds and updates available shapes
Expand Down Expand Up @@ -59,19 +59,12 @@ public static async Task<string> WriteRecord(IConnectionFactory connFactory, Sch

// get previous golden record
List<string> previousRecordVersionIds;
if (await RecordExistsAsync(connFactory, goldenTable, record.RecordId))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RecordExists and GetRecord can be merged into one

var recordMap = await GetRecordAsync(connFactory, goldenTable, record.RecordId);

if (recordMap != null && recordMap.ContainsKey(Constants.ReplicationVersionIds))
{
var recordMap = await GetRecordAsync(connFactory, goldenTable, record.RecordId);

if (recordMap.ContainsKey(Constants.ReplicationVersionIds))
{
previousRecordVersionIds =
JsonConvert.DeserializeObject<List<string>>(recordMap[Constants.ReplicationVersionIds].ToString());
}
else
{
previousRecordVersionIds = recordVersionIds;
}
previousRecordVersionIds =
JsonConvert.DeserializeObject<List<string>>(recordMap[Constants.ReplicationVersionIds].ToString());
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions PluginSnowflake/Helper/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void Validate()
/// <returns></returns>
public string GetConnectionString()
{
return $"account={Account};user={Username};password={Password};db={Database};warehouse={Warehouse};";
return $"account={Account};user={Username};password={Password};db={Database};warehouse={Warehouse};maxPoolSize=50;";
}

/// <summary>
Expand All @@ -57,7 +57,7 @@ public string GetConnectionString()
/// <returns></returns>
public string GetConnectionString(string database)
{
return $"account={Account};user={Username};password={Password};db={database};warehouse={Warehouse};";
return $"account={Account};user={Username};password={Password};db={database};warehouse={Warehouse};maxPoolSize=50;";
}
}
}
4 changes: 2 additions & 2 deletions PluginSnowflake/PluginSnowflake.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

<ItemGroup>
<PackageReference Include="Aunalytics.Sdk" Version="1.3.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Snowflake.Data" Version="1.2.0" />
<PackageReference Include="Snowflake.Data" Version="4.2.0" />
<PackageReference Include="System.Linq.Async" Version="4.0.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion PluginSnowflakeTest/PluginSnowflakeTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="Moq" Version="4.13.1" />
<PackageReference Include="Aunalytics.Sdk" Version="1.3.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
</ItemGroup>
Expand Down