Couldn't create log directory

前端 未结 4 1988
借酒劲吻你
借酒劲吻你 2021-02-07 00:23

When I test my application on iPad it run perfectly i.e. call the database , create folder and perform other task but in console it show me

2015-05-12 1

4条回答
  •  醉酒成梦
    2021-02-07 00:41

    I've been thinking about this scenario, and I can't come up with any better suggestion than: Race Condition? Could it be that two treads are trying to log at the same time? The first one creates the folder directly after the second tread is passing the .fileExistsAtPath check?

    • T1: Folder? -> No
    • T2: Folder? -> No
    • T1: Create
    • T2: WTF? There is a folder here already?

    If this is the case, it could solve the problem by moving the create directory check and logic to a earlier stage, like on App start or similar.

    Not sure this is the issue or that this is the definite answer, so just let's call it a qualified guess... :)

提交回复
热议问题