Skip to content

Commit

Permalink
Update CassandraCSharpDriver to 3.16.3
Browse files Browse the repository at this point in the history
  • Loading branch information
oktal committed Sep 23, 2021
1 parent 7bb6ece commit 73d5f6e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CassandraCSharpDriver" Version="3.7.0" />
<PackageReference Include="CassandraCSharpDriver" Version="3.16.3" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CassandraCSharpDriver" Version="3.7.0" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="5.0.0" />
<PackageReference Include="CassandraCSharpDriver" Version="3.16.3" />
</ItemGroup>

</Project>
20 changes: 11 additions & 9 deletions src/Abc.Zebus.Persistence.CQL/Storage/CqlStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class CqlStorage : ICqlStorage, IDisposable
{
private const int _maxParallelInsertTasks = 64;
private static readonly ILog _log = LogManager.GetLogger(typeof(CqlStorage));
private static readonly DateTime _unixOrigin = new DateTime(1970, 1, 1, 0, 0, 0, 0);
private static readonly DateTime _unixOrigin = new(1970, 1, 1, 0, 0, 0, 0);

private readonly PersistenceCqlDataContext _dataContext;
private readonly PeerStateRepository _peerStateRepository;
Expand Down Expand Up @@ -89,14 +89,16 @@ public Task Write(IList<MatcherEntry> entriesToPersist)

var messageDateTime = matcherEntry.MessageId.GetDateTimeForV2OrV3();
var rowTimestamp = matcherEntry.IsAck ? messageDateTime.AddTicks(10) : messageDateTime;
var boundStatement = _preparedStatement.Bind(matcherEntry.PeerId.ToString(),
BucketIdHelper.GetBucketId(messageDateTime),
messageDateTime.Ticks,
matcherEntry.MessageId.Value,
matcherEntry.IsAck,
matcherEntry.MessageBytes,
(int)PeerState.MessagesTimeToLive.TotalSeconds,
ToUnixMicroSeconds(rowTimestamp));
var boundStatement = _preparedStatement.Bind(
BucketIdHelper.GetBucketId(messageDateTime),
matcherEntry.IsAck,
matcherEntry.MessageId.Value,
matcherEntry.PeerId.ToString(),
matcherEntry.MessageBytes,
messageDateTime.Ticks,
(int)PeerState.MessagesTimeToLive.TotalSeconds,
ToUnixMicroSeconds(rowTimestamp)
);

var insertTask = _dataContext.Session.ExecuteAsync(boundStatement);
insertTasks.Add(insertTask);
Expand Down

0 comments on commit 73d5f6e

Please sign in to comment.