From bb3dd9c856057e78c731eec9a0f737932cc608bb Mon Sep 17 00:00:00 2001 From: Myles <96409608+ice-myles@users.noreply.github.com> Date: Mon, 17 Jun 2024 21:27:14 +0300 Subject: [PATCH] Mining not active remove on new mining session removing fix. (#46) --- go.mod | 12 ++++++------ go.sum | 24 +++++++++++------------ notifications/notification_type_mining.go | 2 ++ 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index e090a5c..2806654 100644 --- a/go.mod +++ b/go.mod @@ -6,8 +6,8 @@ require ( github.com/goccy/go-json v0.10.3 github.com/google/uuid v1.6.0 github.com/hashicorp/go-multierror v1.1.1 - github.com/ice-blockchain/eskimo v1.320.0 - github.com/ice-blockchain/freezer v1.440.0 + github.com/ice-blockchain/eskimo v1.322.0 + github.com/ice-blockchain/freezer v1.443.0 github.com/ice-blockchain/go-tarantool-client v0.0.0-20230327200757-4fc71fa3f7bb github.com/ice-blockchain/wintr v1.140.0 github.com/imroc/req/v3 v3.43.7 @@ -37,7 +37,7 @@ require ( github.com/MicahParks/keyfunc v1.9.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/Microsoft/hcsshim v0.12.4 // indirect - github.com/alitto/pond v1.8.3 // indirect + github.com/alitto/pond v1.9.0 // indirect github.com/andybalholm/brotli v1.1.0 // indirect github.com/bits-and-blooms/bitset v1.13.0 // indirect github.com/bsm/redislock v0.9.4 // indirect @@ -188,9 +188,9 @@ require ( golang.org/x/tools v0.22.0 // indirect google.golang.org/api v0.184.0 // indirect google.golang.org/appengine/v2 v2.0.6 // indirect - google.golang.org/genproto v0.0.0-20240610135401-a8a62080eff3 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240610135401-a8a62080eff3 // indirect + google.golang.org/genproto v0.0.0-20240617180043-68d350f18fd4 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 // indirect google.golang.org/grpc v1.64.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/go.sum b/go.sum index a170065..bc747ad 100644 --- a/go.sum +++ b/go.sum @@ -38,8 +38,8 @@ github.com/Microsoft/hcsshim v0.12.4 h1:Ev7YUMHAHoWNm+aDSPzc5W9s6E2jyL1szpVDJeZ/ github.com/Microsoft/hcsshim v0.12.4/go.mod h1:Iyl1WVpZzr+UkzjekHZbV8o5Z9ZkxNGx6CtY2Qg/JVQ= github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI= github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkThDcMsQicp4xDukwJYI= -github.com/alitto/pond v1.8.3 h1:ydIqygCLVPqIX/USe5EaV/aSRXTRXDEI9JwuDdu+/xs= -github.com/alitto/pond v1.8.3/go.mod h1:CmvIIGd5jKLasGI3D87qDkQxjzChdKMmnXMg3fG6M6Q= +github.com/alitto/pond v1.9.0 h1:B8BrvXyKe97NK9LHuRsQAOmpRnsp6GJ7mCg1Cgitczo= +github.com/alitto/pond v1.9.0/go.mod h1:xQn3P/sHTYcU/1BR3i86IGIrilcrGC2LiS+E2+CJWsI= github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -282,10 +282,10 @@ github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= -github.com/ice-blockchain/eskimo v1.320.0 h1:k9sbqT7Ch9lADW3D1QaRYPFA5KXbUMl9qimPZugwuIw= -github.com/ice-blockchain/eskimo v1.320.0/go.mod h1:0OtvydMjqW/xnf3zxtw10gGuwyA/s49JVVGVbZSx7F8= -github.com/ice-blockchain/freezer v1.440.0 h1:eb0vHkT4wRdT+2mkNEgOivSmfPHsxCpiB6ABCuC3KKo= -github.com/ice-blockchain/freezer v1.440.0/go.mod h1:SrobnI7ouY4jrw6868ojT0odM/JF7htNfkLKpSBNuMw= +github.com/ice-blockchain/eskimo v1.322.0 h1:sc8uMU0yJi1+twQIN3JaQBPJ06P9iA7v2LtOWDTbamI= +github.com/ice-blockchain/eskimo v1.322.0/go.mod h1:0OtvydMjqW/xnf3zxtw10gGuwyA/s49JVVGVbZSx7F8= +github.com/ice-blockchain/freezer v1.443.0 h1:G0FX5RPTqvzgOuP2jjXnn1Jq+bG1NPCsLvNteewGAMw= +github.com/ice-blockchain/freezer v1.443.0/go.mod h1:rnO1HKyWQLcu7qpI4pKBFmZWkl4u1Wx/WghVrFLoebs= github.com/ice-blockchain/go-tarantool-client v0.0.0-20230327200757-4fc71fa3f7bb h1:8TnFP3mc7O+tc44kv2e0/TpZKnEVUaKH+UstwfBwRkk= github.com/ice-blockchain/go-tarantool-client v0.0.0-20230327200757-4fc71fa3f7bb/go.mod h1:ZsQU7i3mxhgBBu43Oev7WPFbIjP4TniN/b1UPNGbrq8= github.com/ice-blockchain/wintr v1.140.0 h1:OGjjZHCD5WWcJ8BRQ5Dmv1xGSPe8DvqSuPwtpXZxUC4= @@ -627,12 +627,12 @@ google.golang.org/appengine/v2 v2.0.6/go.mod h1:WoEXGoXNfa0mLvaH5sV3ZSGXwVmy8yf7 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20240610135401-a8a62080eff3 h1:8RTI1cmuvdY9J7q/jpJWEj5UfgWjhV5MCoXaYmwLBYQ= -google.golang.org/genproto v0.0.0-20240610135401-a8a62080eff3/go.mod h1:qb66gsewNb7Ghv1enkhJiRfYGWUklv3n6G8UvprOhzA= -google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3 h1:QW9+G6Fir4VcRXVH8x3LilNAb6cxBGLa6+GM4hRwexE= -google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3/go.mod h1:kdrSS/OiLkPrNUpzD4aHgCq2rVuC/YRxok32HXZ4vRE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240610135401-a8a62080eff3 h1:9Xyg6I9IWQZhRVfCWjKK+l6kI0jHcPesVlMnT//aHNo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240610135401-a8a62080eff3/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto v0.0.0-20240617180043-68d350f18fd4 h1:CUiCqkPw1nNrNQzCCG4WA65m0nAmQiwXHpub3dNyruU= +google.golang.org/genproto v0.0.0-20240617180043-68d350f18fd4/go.mod h1:EvuUDCulqGgV80RvP1BHuom+smhX4qtlhnNatHuroGQ= +google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4 h1:MuYw1wJzT+ZkybKfaOXKp5hJiZDn2iHaXRw0mRYdHSc= +google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4/go.mod h1:px9SlOOZBg1wM1zdnr8jEL4CNGUBZ+ZKYtNPApNQc4c= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 h1:Di6ANFilr+S60a4S61ZM00vLdw0IrQOSMS2/6mrnOU0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= diff --git a/notifications/notification_type_mining.go b/notifications/notification_type_mining.go index 1e0b864..c1fdb47 100644 --- a/notifications/notification_type_mining.go +++ b/notifications/notification_type_mining.go @@ -50,6 +50,7 @@ func (m *miningSessionSource) Process(ctx context.Context, msg *messagebroker.Me MiningEndingSoonNotificationType, MiningExpiredNotificationType, MiningExtendNotificationType, + MiningNotActiveNotificationType, } if len(old) > 0 { if rErr := m.removeScheduledNotifications(ctx, *message.UserID, notificationTypes); rErr != nil { @@ -81,6 +82,7 @@ func (m *miningSessionSource) getMiningScheduledNotifications(ctx context.Contex MiningEndingSoonNotificationType, MiningExpiredNotificationType, MiningExtendNotificationType, + MiningNotActiveNotificationType, } sql := `SELECT * FROM scheduled_notifications