Async-storage: AsyncStorage.getItem(key)第一次使用时,等待了 2 分钟才返回结果,之后都是毫秒级返回

Created on 18 Jul 2019  ·  7Comments  ·  Source: react-native-async-storage/async-storage

Current behavior

在 Android 中,第一次使用AsyncStorage.getItem(key)读取值,等待了 2 分钟才返回结果,之后都是毫秒级返回

为什么第一次需要等待这么才时间

Expected behavior


以前的版本是没有这个问题的都是很快就返回了

Repro steps


console.log('---read--start', Date.now())
const value = await AsyncStorage.getItem(key);
console.log('---read--end', Date.now())

Environment

  • Async Storage version:

    1.5.1

  • React-Native version: 0.59.8

  • Platform tested: android
  • Logs/Error that are relevant:

Most helpful comment

@yazhengwang Sorry for rough action, but could you please open a new issue (or reopen current one) in English, please?

thanks.

All 7 comments

Only on debug mode?

Only on debug mode?

no ,release also

仅在调试模式下?

不,也发布

i resolved in https://github.com/react-native-community/async-storage/pull/160

@yazhengwang Sorry for rough action, but could you please open a new issue (or reopen current one) in English, please?

thanks.

@Krizzu I resolved ,Thank you ,you can colse it

I'm the Expo user, so I must use the AsyncStorage from react-native. And it's also have the problem on some Android device. Is there any way to fix it?

@Krizzu I resolved ,Thank you ,you can colse it

我也遇到同样的问题,你是怎么解决的?

Was this page helpful?
0 / 5 - 0 ratings