Implementing a set-before-get-behaviour with presets

Oliver Kraitschy okraits at arcor.de
Tue Mar 22 08:40:29 EDT 2016


On Mon, Mar 21, 2016 at 07:47:02PM +0300, Zaid Abdulla wrote:

> That's due to caching. It's a limitation in this version and is
> unfortunately difficult to fix without introducing undesired side
> effects. A quick workaround is to add a "refersh" configuration in your
> first preset with interval of 1 second. This will force the cache
> duration to not exceed 1 second which should hopefully be enough time
> for it to expire within the same session.

Unfortunately, this still doesn't trigger the execution of the second preset.
This is what my presets look right now:

{
  "weight":1,
  "precondition":"{\"_tags\":{\"$ne\":\"configured\"}}",
  "configurations":
    [
      {"type":"add_tag","tag":"configured"},
      {"type":"age","name":"InternetGatewayDevice.DeviceInfo.UpTime","age":"1"}
    ],
  "_id":"1-SetConfiguration"
},

{
  "weight":1,
  "precondition":"{\"_tags\":\"configured\"}",
  "configurations":
    [
      {"type":"age","name":"InternetGatewayDevice.DeviceInfo.SerialNumber","age":"43200"},
      {"type":"add_tag","tag":"refreshed"}
    ],
  "_id":"2-RefreshConfiguration"
}

Should i set the interval of the refresh configuration in the first preset
to a higher value, 5 seconds for example?

Thank you for your help in advance.

Greetings,
Oliver


More information about the Users mailing list