Skip to content

Commit

Permalink
fix: reset gateway durable objects migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Feb 8, 2022
1 parent 9f3c859 commit 08d1139
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/gateway/src/durable-objects/summary-metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const RESPONSE_TIME_HISTOGRAM_ID = 'responseTimeHistogram'
/**
* Durable Object for keeping summary metrics of gateway.nft.storage
*/
export class SummaryMetrics1 {
export class SummaryMetrics0 {
constructor(state) {
this.state = state

Expand Down
2 changes: 1 addition & 1 deletion packages/gateway/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { metricsGet } from './metrics.js'

// Export Durable Object namespace from the root module.
export { GatewayMetrics0 } from './durable-objects/gateway-metrics.js'
export { SummaryMetrics1 } from './durable-objects/summary-metrics.js'
export { SummaryMetrics0 } from './durable-objects/summary-metrics.js'
export { CidsTracker0 } from './durable-objects/cids.js'
export { GatewayRateLimits0 } from './durable-objects/gateway-rate-limits.js'
export { GatewayRedirectCounter0 } from './durable-objects/gateway-redirect-counter.js'
Expand Down
19 changes: 6 additions & 13 deletions packages/gateway/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ main = "index.mjs"
[durable_objects]
bindings = [
{name = "GATEWAYMETRICS", class_name = "GatewayMetrics0"},
{name = "SUMMARYMETRICS", class_name = "SummaryMetrics1"},
{name = "SUMMARYMETRICS", class_name = "SummaryMetrics0"},
{name = "CIDSTRACKER", class_name = "CidsTracker0"},
{name = "GATEWAYRATELIMITS", class_name = "GatewayRateLimits0"},
{name = "GATEWAYREDIRECTCOUNTER", class_name = "GatewayRedirectCounter0"}
Expand All @@ -40,7 +40,7 @@ ENV = "production"
[env.production.durable_objects]
bindings = [
{name = "GATEWAYMETRICS", class_name = "GatewayMetrics0"},
{name = "SUMMARYMETRICS", class_name = "SummaryMetrics1"},
{name = "SUMMARYMETRICS", class_name = "SummaryMetrics0"},
{name = "CIDSTRACKER", class_name = "CidsTracker0"},
{name = "GATEWAYRATELIMITS", class_name = "GatewayRateLimits0"},
{name = "GATEWAYREDIRECTCOUNTER", class_name = "GatewayRedirectCounter0"}
Expand All @@ -61,7 +61,7 @@ ENV = "staging"
[env.staging.durable_objects]
bindings = [
{name = "GATEWAYMETRICS", class_name = "GatewayMetrics0"},
{name = "SUMMARYMETRICS", class_name = "SummaryMetrics1"},
{name = "SUMMARYMETRICS", class_name = "SummaryMetrics0"},
{name = "CIDSTRACKER", class_name = "CidsTracker0"},
{name = "GATEWAYRATELIMITS", class_name = "GatewayRateLimits0"},
{name = "GATEWAYREDIRECTCOUNTER", class_name = "GatewayRedirectCounter0"}
Expand All @@ -79,7 +79,7 @@ ENV = "test"
[env.test.durable_objects]
bindings = [
{name = "GATEWAYMETRICS", class_name = "GatewayMetrics0"},
{name = "SUMMARYMETRICS", class_name = "SummaryMetrics1"},
{name = "SUMMARYMETRICS", class_name = "SummaryMetrics0"},
{name = "CIDSTRACKER", class_name = "CidsTracker0"},
{name = "GATEWAYRATELIMITS", class_name = "GatewayRateLimits0"},
{name = "GATEWAYREDIRECTCOUNTER", class_name = "GatewayRedirectCounter0"}
Expand All @@ -96,19 +96,12 @@ IPFS_GATEWAYS = "[\"https://ipfs.io\"]"
[env.vsantos.durable_objects]
bindings = [
{name = "GATEWAYMETRICS", class_name = "GatewayMetrics0"},
{name = "SUMMARYMETRICS", class_name = "SummaryMetrics1"},
{name = "SUMMARYMETRICS", class_name = "SummaryMetrics0"},
{name = "CIDSTRACKER", class_name = "CidsTracker0"},
{name = "GATEWAYRATELIMITS", class_name = "GatewayRateLimits0"},
{name = "GATEWAYREDIRECTCOUNTER", class_name = "GatewayRedirectCounter0"}
]

[[migrations]]
tag = "v1" # Should be unique for each entry
new_classes = ["GatewayMetrics0", "SummaryMetrics0", "CidsTracker0", "GatewayRateLimits0"]
[[migrations]]
tag = "v2" # Should be unique for each entry
new_classes = ["SummaryMetrics1"]
deleted_classes = ["SummaryMetrics0"]
[[migrations]]
tag = "v3" # Should be unique for each entry
new_classes = ["GatewayRedirectCounter0"]
new_classes = ["GatewayMetrics0", "SummaryMetrics0", "CidsTracker0", "GatewayRateLimits0", "GatewayRedirectCounter0"]

0 comments on commit 08d1139

Please sign in to comment.