Fix param in remove exposure

This commit is contained in:
QiTao Weng 2021-04-11 02:52:09 +00:00
parent 105e460812
commit 3cb0a91d2a

View File

@ -46,21 +46,9 @@ export class Exposure extends Unit {
public async up() { public async up() {
this.firebase.ref('exposure').on('child_added', (snapshot) => { this.firebase.ref('exposure').on('child_added', (snapshot) => {
this.blockchain.submitExposures(snapshot.val()) this.blockchain.submitExposures(snapshot.val())
this.firebase.ref('exposure').child(snapshot.val()).remove() if (snapshot.key) {
/*this.logging.debug('Received child_added event for exposures reference.') this.firebase.ref('exposure').child(snapshot.key).remove()
if ( !this.claim() ) return }
// await this.firebase.trylock('block', 'Exposure_child_added')
const exposure: ExposureResourceItem = snapshot.val()
// Push the exposure transactions onto the chain
await this.blockchain.submitExposures(exposure)
if ( snapshot.key )
await (<ExposureResource> this.make(ExposureResource)).ref().child(snapshot.key).remove()
this.release()
// await this.firebase.unlock('block')*/
}) })
} }