MCPcopy Index your code
hub / github.com/SavioAndres/BrasilAPI-Java / updateCache

Method updateCache

src/main/java/br/com/brasilapi/Cache.java:64–83  ·  view source on GitHub ↗

Verifica e atualiza o Cache limpando e redefinido o tempo atual.

()

Source from the content-addressed store, hash-verified

62 * Verifica e atualiza o Cache limpando e redefinido o tempo atual.
63 */
64 private static void updateCache() {
65 // Caso o tempo do Cache definido do Cache tenha excedido
66 if (!mapCache.isEmpty() && System.currentTimeMillis() - startTime > cacheTime) {
67
68 // Log do Cache a ser limpo
69 Log.setConsole("Cache atual a ser limpo: " + mapCache.toString());
70
71 // Limpar Cache
72 mapCache.clear();
73
74 // Atualizar tempo atual
75 startTime = System.currentTimeMillis();
76
77 // Log do Cache atual
78 Log.setConsole("Tempo de " + cacheTime
79 + " milissegundos excedido.\nCache limpo. Cache atual: "
80 + mapCache.toString());
81
82 }
83 }
84
85}

Callers 2

setCacheMethod · 0.95
getCacheMethod · 0.95

Calls 2

setConsoleMethod · 0.95
toStringMethod · 0.45

Tested by

no test coverage detected