Skip to content

Commit

Permalink
Fix context for StreamDataActor (#30)
Browse files Browse the repository at this point in the history
Co-authored-by: moh38208 <[email protected]>
  • Loading branch information
m-alreeni and moh38208 authored Sep 11, 2024
1 parent bb64f4e commit ca1b5ec
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class StreamDataActor extends CometActor with KvinListener {
}

override def localSetup {
context = Globals.contextModel.vend.map(_.getURI).openOr(Kvin.DEFAULT_CONTEXT)
context = Data.currentModel.map(_.getURI).openOr(Kvin.DEFAULT_CONTEXT)
limit = attributes.get("limit").map(_.toInt).getOrElse(DEFAULT_LIMIT)
itemsOrPatterns = attributes.get("items").map(_.split("\\s+").filter(_.nonEmpty).map(URIs.createURI(_, true)))
.filter(_.nonEmpty).map(_.toSet).getOrElse {
Expand Down Expand Up @@ -177,7 +177,7 @@ class StreamDataActor extends CometActor with KvinListener {
val propInfo = propertyInfo(property, propInfos)
var timestamp = propInfo.lastTimestamp

val propData = Data.kvin.map(_.fetch(item, property, Kvin.DEFAULT_CONTEXT, KvinTuple.TIME_MAX_VALUE, timestamp, 100, 0L, null)
val propData = Data.kvin.map(_.fetch(item, property, context, KvinTuple.TIME_MAX_VALUE, timestamp, 100, 0L, null)
.iterator.asScala.map { e =>
timestamp = timestamp.max(e.time)
("time", e.time) ~ ("seqNr", decompose(e.seqNr)) ~ ("value", decompose(e.value))
Expand Down

0 comments on commit ca1b5ec

Please sign in to comment.