Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

I want to store matrices in the shared cache. It looks like I have an issue with fetching them.

I do the following:

  1. Change the map to a string.

    Code Block
    finalMatrix = api.jsonEncode(finalMatrix)
  2. Store the string with the tableName.

    Code Block
    def tableName = (configSister + ":" + hwg).toString()
    finalMatrices = api.setSharedCache(tableName, finalMatrix) // The shared cache key size should not exceed 10k bytes.
  3. Fetch the string from the shared cache. 

    Code Block
    if(finalMatrices != null){
    	finalMatrix = api.getSharedCache(tableName)
    }
  4. Change the string to a map again.

    Code Block
    finalMatrix = api.jsonDecode(finalMatrix)

With changing it back to a map I think there is a problem. If I want to fetch a specific line from it afterwards with finalMatrix.findRow("Product ID", productId) it breaks.

...