Skip to content

Commit

Permalink
[YOMA-574] ZLTO Marketplace Item Reservation Expiration: Changed from…
Browse files Browse the repository at this point in the history
… planned 4 hours to 30 minutes (#1127)

* ZLTO Marketplace Item Reservation Expiration: Changed from planned 4 hours to 30 minutes

* Update ZLTO Item Reservation

---------

Co-authored-by: Robbie Blaine <robbieblaine.rb@gmail.com>
  • Loading branch information
adrianwium and rblaine95 authored Oct 24, 2024
1 parent 09e744d commit aded4f9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions helm/yoma-api/conf/base/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ appSettings:
MaxRetryDelayInSeconds: ENC[AES256_GCM,data:8Qg=,iv:MuvbV84T+PCTA2gmeQEnKVzjFP87bSYnA6cyUV2EARI=,tag:a0UrKQSGbFUBEj+sLjaHhw==,type:int]
HttpsRedirectionEnabledEnvironments: null
LaborMarketProviderAsSourceEnabledEnvironments: ENC[AES256_GCM,data:IecYNDMUbku4yw==,iv:yCBDnacezc1gX+R0cF1PhIoBDlrBuBYZQaJPmF5J/EA=,tag:LMJwRFNwgWrUdV36PuGmUQ==,type:str]
MarketplaceItemReservationExpirationInHours: ENC[AES256_GCM,data:uuU=,iv:q6TPVkMMWHGTtPbEcN4BRA5ZIciXGOSMYO+05covxv4=,tag:7trRbwQillGm8ZmOUhkZBA==,type:int]
MarketplaceItemReservationExpirationInMinutes: ENC[AES256_GCM,data:K9A=,iv:/IQiK7Yx6pyU318fPyin7FHl3mjKzm+bJOW5AL/nlJg=,tag:L5Ptn27blsgnM0WzJT4a0A==,type:int]
PartnerSharingEnabledEnvironments: ENC[AES256_GCM,data:oe1qKd6Ms2XhbCusSEn/f80pjw==,iv:sziiHuaR5snwZ3ssr8V1grD8sKZR0cwClfFhT2Yo69Q=,tag:6DfhD1JGjQa45MxeRMNy7w==,type:str]
PartnerSharingMaximumRetryAttempts: ENC[AES256_GCM,data:WQ==,iv:LAFHP1IQH5CtFQn/DHFTTItiIEP2xY82rGoUp5vcWWM=,tag:Ytn/vmSX/8L+L9iovMnmOw==,type:int]
RedisSSLCertificateValidationBypass: ENC[AES256_GCM,data:Cc9xuw==,iv:tsIXhonaI8yzpfy1QBaw1fGYnJ/xryXF2dcMtitzlTY=,tag:pWGyVe15YzJVdih0KOK8dA==,type:bool]
Expand Down Expand Up @@ -241,8 +241,8 @@ sops:
azure_kv: []
hc_vault: []
age: []
lastmodified: "2024-09-18T12:45:49Z"
mac: ENC[AES256_GCM,data:B8pbvv6MTgTdemSa4PNj1iwaVSnGwj/JCM6wu3v+pvqkS0YE1/4NyvquZtG/8moPrd1sk0iMTo9IHcD4QD5ND9rc83M11v8l1rIko6YsWeSpLi3bGiyGCOBugPFrWuUjS1XF5BJRmM3D3hZ68eQRTFL3YI9r5TWFNwOMaGzVzek=,iv:WRj4IR63b1c0hMTsx/SKAg3hxcYj4zUJG6jXCDk0k04=,tag:LRbXTdc2RUMVkIDBoVd3Fw==,type:str]
lastmodified: "2024-10-24T08:24:36Z"
mac: ENC[AES256_GCM,data:sXfc3C8aGpHU38OkDNskj8hzvGOI38A/INpcAhMy4Dq7PHnhuhKImvFlGKbrb9UA+SP4dmSeHeQ1yUPMDd/z+O/m3P81d/FgXvwlo5c3i42GFbB9uH71fiI2E/WWNRSnnZOh6uLrJDVNuAFsDG+0kWlTS1XjrgrRHVrUXsEXWkI=,iv:mVpZIkuhf8RL1JHLkjZbaK8Q+4gfRzLqHJFZJFB2LUs=,tag:nv7bsyasxlfbm3emPPbV1Q==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.0
version: 3.9.1
2 changes: 1 addition & 1 deletion src/api/src/application/Yoma.Core.Api/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"ShortLinkProviderAsSourceEnabledEnvironments": "Development, Staging, Production",
"PartnerSharingEnabledEnvironments": null,
"PartnerSharingMaximumRetryAttempts": 5,
"MarketplaceItemReservationExpirationInHours": -1,
"MarketplaceItemReservationExpirationInMinutes": 30,
"DatabaseRetryPolicy": {
"MaxRetryCount": 6,
"MaxRetryDelayInSeconds": 30
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ public CacheItemType CacheEnabledByCacheItemTypesAsEnum
/// Determines the expiration behavior for item reservations
/// -1: Never expires
/// 0: Expires immediately
/// >0: Specifies the expiration time in hours
/// >0: Specifies the expiration time in minutes
/// </summary>
public int MarketplaceItemReservationExpirationInHours { get; set; }
public int MarketplaceItemReservationExpirationInMinutes { get; set; }

public AppSettingsDatabaseRetryPolicy DatabaseRetryPolicy { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ public async Task BuyItem(string storeId, string itemCategoryId)
TransactionLog? transaction = null;
if (transactionExisting != null && transactionExisting.Status == TransactionStatus.Reserved)
{
//check if reservation expired (-1: never expires | 0: expires immediately | >0: expires in x hours)
if (_appSettings.MarketplaceItemReservationExpirationInHours >= 0 && transactionExisting.DateModified.AddHours(_appSettings.MarketplaceItemReservationExpirationInHours) <= DateTimeOffset.UtcNow)
//check if reservation expired (-1: never expires | 0: expires immediately | >0: expires in x minutes)
if (_appSettings.MarketplaceItemReservationExpirationInMinutes >= 0 && transactionExisting.DateModified.AddMinutes(_appSettings.MarketplaceItemReservationExpirationInMinutes) <= DateTimeOffset.UtcNow)
{
//expired; mark as released and create a new reservation
transactionExisting.StatusId = _transactionStatusService.GetByName(TransactionStatus.Released.ToString()).Id;
Expand Down

0 comments on commit aded4f9

Please sign in to comment.