Skip to content

Commit

Permalink
Merge pull request 'fix: subspace schedule' (#24) from fix/get-schedu…
Browse files Browse the repository at this point in the history
  • Loading branch information
tester-testing-person committed Mar 4, 2024
2 parents de1ba40 + 4cdb86d commit 3ec02f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/daemon/src/modules/scheduler/schedule.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Path from 'path'
import * as dagCbor from '@ipld/dag-cbor'
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
import { type Entry, EncodedEntry } from './interface.js'
import { type Entry, EncodedEntry, SCHEDULE_KEY } from './interface.js'
import { encodeEntry, decodeEntry } from './utils.js'
import type { KeyvalueDB } from '@/interface.js'
import { decodeAny } from '@/utils.js'
Expand All @@ -27,7 +27,7 @@ export class Schedule {
async * all (): AsyncGenerator<Entry> {
const index = await this.database.store.latest()

for await (const pair of index.query({})) {
for await (const pair of index.query({ prefix: Path.join('/', SCHEDULE_KEY) })) {
// Ignore null values...
if (decodeAny(pair.value) == null) {
continue
Expand Down Expand Up @@ -55,6 +55,6 @@ export class Schedule {
this.write = write
}

return Path.join('/', uint8ArrayToString(this.id), `${this.write}`, `${this.sequence}`)
return Path.join('/', SCHEDULE_KEY, uint8ArrayToString(this.id), `${this.write}`, `${this.sequence}`)
}
}

0 comments on commit 3ec02f6

Please sign in to comment.