In bacnet_soap_get_value(), you are always setting cache_set and cache_get. I'd suggest doing cache_get first, and if it returns false, then run the query against the soap server to get the value, and caching that result. If cache_get returns false, use the request from the soap server, otherwise use the cached response.

Comments

dbt102’s picture

Title: refactor bacnet_aoap_get_value » refactor bacnet_soap_get_value
dbt102’s picture

Status: Active » Closed (works as designed)

Running cache_get first pulls in the last cached value if it is present. However, this module is intended to show a portion of the data history up to the NOW value. By setting the NOW value first by running the cache_set first, that NOW value will update the last cached NOW and therefore be most current.

This method is simple and effective so I would like to keep it this way for now. As the module matures, a more complex routine can be implemented based on user feedback.

dbt102’s picture

Status: Closed (works as designed) » Closed (fixed)
dbt102’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

Reopening this issue and marking it as postponed so that it can be further looked at as part of the broader phase 2 refactoring effort.

dbt102’s picture

  • dbt102 committed b7627bc on 7.x-1.x
    #2319391#comment-9165031 by dbt: Revisions improving use of soap
    
dbt102’s picture

Version: » 7.x-1.0
Status: Postponed (maintainer needs more info) » Closed (fixed)