Closed su-chang closed 4 years ago
Please check if you close the flashStore
instance correctly when you are resetting the puppet.
If you open a flash store workdir for the second time without close the previous one, you will not be able to get the lock.
That's by design, so we need to use LOCK_EX instead of LOCK_SH for flock
. See: http://man7.org/linux/man-pages/man2/flock.2.html
Thanks for your response, I have found the reason of this bug, one FlashStore has not been closed success. Everything is ok now!
Thanks for learning something about LOCK_EX and LOCK_SH too~
Glad to know that. Cheers!
In the constructor of FlashStore, I have some questions about these code:
I found that if we call
wechaty.reset()
some Errors will happened, and then we can not use cache any more.If we change the params
exnb
toshnb
in methodflockSync(this.lockFd, 'exnb')
, it would make cache work in the next start.But I'm not sure it would make some other bugs or not.