Skip to content

Commit

Permalink
Revert CRL rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
jsha committed May 28, 2024
1 parent 4c20f5a commit 396f68c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sa/sa.go
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ func (ssa *SQLStorageAuthority) leaseOldestCRLShard(ctx context.Context, req *sa
VALUES (?, ?, ?)`,
req.IssuerNameID,
shardIdx,
req.Until.AsTime().Truncate(time.Second),
req.Until.AsTime(),
)
if err != nil {
return -1, fmt.Errorf("inserting selected shard: %w", err)
Expand All @@ -1168,7 +1168,7 @@ func (ssa *SQLStorageAuthority) leaseOldestCRLShard(ctx context.Context, req *sa
WHERE issuerID = ?
AND idx = ?
LIMIT 1`,
req.Until.AsTime().Truncate(time.Second),
req.Until.AsTime(),
req.IssuerNameID,
shardIdx,
)
Expand Down Expand Up @@ -1224,7 +1224,7 @@ func (ssa *SQLStorageAuthority) leaseSpecificCRLShard(ctx context.Context, req *
VALUES (?, ?, ?)`,
req.IssuerNameID,
req.MinShardIdx,
req.Until.AsTime().Truncate(time.Second),
req.Until.AsTime(),
)
if err != nil {
return nil, fmt.Errorf("inserting selected shard: %w", err)
Expand All @@ -1236,7 +1236,7 @@ func (ssa *SQLStorageAuthority) leaseSpecificCRLShard(ctx context.Context, req *
WHERE issuerID = ?
AND idx = ?
LIMIT 1`,
req.Until.AsTime().Truncate(time.Second),
req.Until.AsTime(),
req.IssuerNameID,
req.MinShardIdx,
)
Expand Down Expand Up @@ -1279,7 +1279,7 @@ func (ssa *SQLStorageAuthority) UpdateCRLShard(ctx context.Context, req *sapb.Up
}

_, err := db.WithTransaction(ctx, ssa.dbMap, func(tx db.Executor) (interface{}, error) {
thisUpdate := req.ThisUpdate.AsTime().Truncate(time.Second)
thisUpdate := req.ThisUpdate.AsTime().Truncate(time.Second).Add(time.Second)
res, err := tx.ExecContext(ctx,
`UPDATE crlShards
SET thisUpdate = ?, nextUpdate = ?, leasedUntil = ?
Expand Down

0 comments on commit 396f68c

Please sign in to comment.