Merge branch 'keydbpro' into PRO_RELEASE_6

Former-commit-id: 51e889277c59adb25a8724b25706631e6adca366
This commit is contained in:
John Sully 2020-03-01 22:17:04 -05:00
commit eb1c6d5743
3 changed files with 20 additions and 13 deletions

View File

@ -108,6 +108,11 @@ ifeq ($(USE_JEMALLOC),no)
MALLOC=libc MALLOC=libc
endif endif
ifeq ($(NO_LICENSE_CHECK),yes)
CXXFLAGS+=-DNO_LICENSE_CHECK=1
endif
# Override default settings if possible # Override default settings if possible
-include .make-settings -include .make-settings

View File

@ -1103,6 +1103,7 @@ void serverLog(int level, const char *fmt, ...) {
static void checkTrialTimeout() static void checkTrialTimeout()
{ {
#ifndef NO_LICENSE_CHECK
if (cserver.license_key != nullptr && FValidKey(cserver.license_key, strlen(cserver.license_key))) if (cserver.license_key != nullptr && FValidKey(cserver.license_key, strlen(cserver.license_key)))
return; return;
time_t curtime = time(NULL); time_t curtime = time(NULL);
@ -1118,6 +1119,7 @@ static void checkTrialTimeout()
{ {
serverLog(LL_WARNING, "Trial timeout in %ld:%02ld minutes", remaining/60, remaining % 60); serverLog(LL_WARNING, "Trial timeout in %ld:%02ld minutes", remaining/60, remaining % 60);
} }
#endif
} }
/* Log a fixed message without printf-alike capabilities, in a way that is /* Log a fixed message without printf-alike capabilities, in a way that is

View File

@ -1,47 +1,47 @@
start_server {tags {"CRON"} overrides {hz 100} } { start_server {tags {"CRON"} overrides {hz 100} } {
test {cron singleshot past tense} { test {keydb.cron singleshot past tense} {
r flushall r flushall
r cron testjob single 0 1 {redis.call("incr", "testkey")} 1 testkey r keydb.cron testjob single 0 1 {redis.call("incr", "testkey")} 1 testkey
after 300 after 300
assert_equal 1 [r get testkey] assert_equal 1 [r get testkey]
assert_equal 0 [r exists testjob] assert_equal 0 [r exists testjob]
} }
test {cron repeat past tense next exec is in the future} { test {keydb.cron repeat past tense next exec is in the future} {
r flushall r flushall
r cron testjob repeat 0 1000000 {redis.call("incr", "testkey")} 1 testkey r keydb.cron testjob repeat 0 1000000 {redis.call("incr", "testkey")} 1 testkey
after 300 after 300
assert_equal 1 [r get testkey] assert_equal 1 [r get testkey]
assert_equal 1 [r exists testjob] assert_equal 1 [r exists testjob]
r del testjob r del testjob
} }
test {cron repeat works} { test {keydb.cron repeat works} {
r flushall r flushall
r cron testjob repeat 0 600 {redis.call("incr","testkey")} r keydb.cron testjob repeat 0 600 {redis.call("incr","testkey")}
after 1000 after 1000
assert_equal 2 [r get testkey] assert_equal 2 [r get testkey]
} }
test {cron overwrite works} { test {keydb.cron overwrite works} {
r flushall r flushall
r cron testjob single 500 {redis.call("set","testkey","a")} 1 testkey r keydb.cron testjob single 500 {redis.call("set","testkey","a")} 1 testkey
r cron testjob single 500 {redis.call("set","anotherkey","b")} 1 anotherkey r keydb.cron testjob single 500 {redis.call("set","anotherkey","b")} 1 anotherkey
after 1000 after 1000
assert_equal 0 [r exists testkey] assert_equal 0 [r exists testkey]
assert_equal b [r get anotherkey] assert_equal b [r get anotherkey]
} }
test {cron delete key stops job} { test {keydb.cron delete key stops job} {
r flushall r flushall
r cron testjob single 500 {redis.call("set","testkey","a")} r keydb.cron testjob single 500 {redis.call("set","testkey","a")}
r del testjob r del testjob
after 1000 after 1000
assert_equal 0 [r exists testkey] assert_equal 0 [r exists testkey]
} }
test {cron zero interval rejected} { test {keydb.cron zero interval rejected} {
catch {r cron testjob single 0 0 {redis.call("incr","testkey")} 1 testkey} e catch {r keydb.cron testjob single 0 0 {redis.call("incr","testkey")} 1 testkey} e
assert_match {ERR*} $e assert_match {ERR*} $e
} }
} }