Browse Source

kill before clearing

develop
Gaëtan Renaudeau 6 years ago
parent
commit
986032e7c8
No known key found for this signature in database GPG Key ID: 7B66B85F042E5451
  1. 5
      src/commands/libcoreReset.js
  2. 4
      src/helpers/reset.js

5
src/commands/libcoreReset.js

@ -7,9 +7,8 @@ import withLibcore from 'helpers/withLibcore'
type Input = void type Input = void
type Result = boolean type Result = boolean
const cmd: Command<Input, Result> = createCommand( const cmd: Command<Input, Result> = createCommand('libcoreReset', () =>
'libcoreReset', from(withLibcore(core => core.getPoolInstance().freshResetAll())),
() => from(withLibcore(core => core.getPoolInstance().freshResetAll()))
) )
export default cmd export default cmd

4
src/helpers/reset.js

@ -9,8 +9,10 @@ import killInternalProcess from 'commands/killInternalProcess'
import libcoreReset from 'commands/libcoreReset' import libcoreReset from 'commands/libcoreReset'
async function resetLibcore() { async function resetLibcore() {
await libcoreReset.send().toPromise() // we need to stop everything that is happening right now, like syncs
await killInternalProcess.send().toPromise() await killInternalProcess.send().toPromise()
// we can now ask libcore to reset itself
await libcoreReset.send().toPromise()
} }
function reload() { function reload() {

Loading…
Cancel
Save