Skip to content

Commit

Permalink
Account id counter (#273)
Browse files Browse the repository at this point in the history
* email delivery attempt export (#271)

* fix: 💚 remove falinig test on migration

since now we have dropped the new migration logic
  • Loading branch information
ignazio-bovo committed Dec 6, 2023
1 parent fe6279a commit 3dc596a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 24 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,3 @@ jobs:
run: make prepare
- name: Run tests
run: npm run tests:mail-scheduler
post-update-migrations:
name: Post update migrations tests
needs: [migrations]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.x]
fail-fast: true
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{matrix.node-version}}
uses: actions/setup-node@v1
with:
node-version: ${{matrix.node-version}}
- name: Prepare workspace
run: make prepare
- name: Run tests
run: npm run tests:migrations
3 changes: 0 additions & 3 deletions src/mappings/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { createType } from '@joystream/types'
import { u8aToHex } from '@polkadot/util'
import { CommentCountersManager } from '../utils/CommentsCountersManager'
import { VideoRelevanceManager } from '../utils/VideoRelevanceManager'
import { NextEntityIdManager } from '../utils/NextEntityIdManager'

export const commentCountersManager = new CommentCountersManager()
export const videoRelevanceManager = new VideoRelevanceManager()
Expand All @@ -19,8 +18,6 @@ void videoRelevanceManager.init({
fullUpdateLoopTime: 1000 * 60 * 60 * 12, // 12 hrs
scheduledUpdateLoopTime: 1000 * 60 * 10, // 10 mins
})
export const migrateCounters = new NextEntityIdManager()

export const JOYSTREAM_SS58_PREFIX = 126

export function bytesToString(b: Uint8Array): string {
Expand Down
3 changes: 1 addition & 2 deletions src/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ import { Event } from './types/support'
import { assertAssignable } from './utils/misc'
import { EntityManagerOverlay } from './utils/overlay'
import { EventNames, EventHandler, eventConstructors, EventInstance } from './utils/events'
import { commentCountersManager, migrateCounters, videoRelevanceManager } from './mappings/utils'
import { commentCountersManager, videoRelevanceManager } from './mappings/utils'
import { EntityManager } from 'typeorm'
import { OffchainState } from './utils/offchainState'

Expand Down Expand Up @@ -331,7 +331,6 @@ processor.run(new TypeormDatabase({ isolationLevel: 'READ COMMITTED' }), async (
await commentCountersManager.updateVideoCommentsCounters(em, true)
await commentCountersManager.updateParentRepliesCounters(em, true)
await videoRelevanceManager.updateVideoRelevanceValue(em, true)
await migrateCounters.migrateCounters(overlay)
ctx.log.info(`Offchain state successfully imported!`)
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/utils/offchainState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ export class OffchainState {
)
}

// migrate counter values
const { exportedVersion } = exportFile
await this.migrateCounters(exportedVersion, em)

const renamedExportFilePath = `${exportFilePath}.imported`
this.logger.info(`Renaming export file to ${renamedExportFilePath})...`)
fs.renameSync(exportFilePath, renamedExportFilePath)
Expand Down

0 comments on commit 3dc596a

Please sign in to comment.