mirror of
https://github.com/jimeh/redistat.git
synced 2026-02-19 13:26:39 +00:00
added standard redis key name constants
This commit is contained in:
@@ -12,6 +12,11 @@ require "redistat/label"
|
||||
require "redistat/date"
|
||||
|
||||
module Redistat
|
||||
|
||||
KEY_NEXT_EVENT_ID = "Redistat.next_event_id"
|
||||
KEY_EVENT_PREFIX = "Redistat.event:"
|
||||
KEY_LEBELS_PREFIX = "Redistat.lables:"
|
||||
KEY_EVENT_IDS_SUFFIX = ".event_ids"
|
||||
|
||||
# Provides access to the Redis database. This is shared accross all models and instances.
|
||||
def redis
|
||||
|
||||
@@ -11,7 +11,7 @@ module Redistat
|
||||
end
|
||||
|
||||
def save
|
||||
@saved = (db.set("Redistat:lables:#{@hash}", @name) == "OK")
|
||||
@saved = (db.set("#{KEY_LEBELS_PREFIX}#{@hash}", @name) == "OK")
|
||||
self
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user