         #    console.log "last session is ", err, res
 
         # what sessions have we seen since then?
+
+        # -- Redis Session Sweep -- #
+
+        if @redis
+            @log.info "Analytics setting up Redis session sweeper"
+
+            setInterval =>
+                # look for sessions that should be written (score less than now)
+                @redis.zrangebyscore 0, Math.floor( Number(new Date) / 1000), (err,sessions) =>
+                    return @log.error "Error fetching sessions to finalize: #{err}" if err
+
+                    _sFunc = =>
+                        if s = sessions.shift()
+                            @_triggerSession s
+                            _sFunc()
+
+                    _sFunc()
+
+            , 5*1000
 
     #----------
 


    #----------

    _ensureMemorySession: (session) ->
        @sessions[ session ] ||= duration:0, last_seen_at:Number(new Date())

    #----------



        @log = @opts.log

        @_timeout_sec = Number(@opts.config.finalize_secs)

        if @opts.redis

            @redis = @opts.redis.client

        @es = new elasticsearch.Client
