66 "encoding/json"
77 "errors"
88 "fmt"
9- "strconv"
109 "strings"
1110
1211 amqp "github.com/rabbitmq/amqp091-go"
@@ -304,7 +303,7 @@ type SubscriptionFeatures struct {
304303
305304type SubscriptionStackFeatures struct {
306305 FeatureSets []string `json:"featureSets"`
307- DiskQuota string `json:"diskQuota"`
306+ DiskQuota int64 `json:"diskQuota"`
308307}
309308
310309func (h * DomainSubscriptionChangedHandler ) Handle (ctx context.Context , d amqp.Delivery ) error {
@@ -327,14 +326,6 @@ func (h *DomainSubscriptionChangedHandler) Handle(ctx context.Context, d amqp.De
327326 if msg .Features .Stack .FeatureSets == nil {
328327 return fmt .Errorf ("domain.subscription.changed: missing feature sets for organization %s: %v" , msg .Domain , msg .Features )
329328 }
330- if msg .Features .Stack .DiskQuota == "" {
331- return fmt .Errorf ("domain.subscription.changed: missing disk quota for organization %s: %v" , msg .Domain , msg .Features )
332- }
333-
334- quota , err := strconv .ParseInt (msg .Features .Stack .DiskQuota , 10 , 64 )
335- if err != nil {
336- return fmt .Errorf ("domain.subscription.changed: invalid disk quota for organization %s: %w" , msg .Domain , err )
337- }
338329
339330 list , err := lifecycle .ListOrgInstances (msg .Domain )
340331 if err != nil {
@@ -347,7 +338,7 @@ func (h *DomainSubscriptionChangedHandler) Handle(ctx context.Context, d amqp.De
347338
348339 for _ , inst := range list {
349340 if err := lifecycle .Patch (inst , & lifecycle.Options {
350- DiskQuota : quota ,
341+ DiskQuota : msg . Features . Stack . DiskQuota ,
351342 FeatureSets : msg .Features .Stack .FeatureSets ,
352343 FromCloudery : true , // XXX: do not update the instance on the Cloudery as the message comes from the Cloudery
353344 }); err != nil {
0 commit comments