mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
commands arguments improvement about unix-time type (#10203)
Change the name to unix-time-seconds or unix-time-milliseconds to be consistent. Change the type from INTEGER to UNIX_TIME. SET (EXAT and PXAT) was already ok. and naming aside, both PXAT and EXAT everywhere used unit-time (for both milliseconds and seconds). the only ones that where wrong are GETEX and XCLAIM (using "integer" for both seconds and milliseconds)
This commit is contained in:
parent
76784e4ece
commit
93d951556b
@ -1240,7 +1240,7 @@ struct redisCommandArg EXPIREAT_condition_Subargs[] = {
|
|||||||
/* EXPIREAT argument table */
|
/* EXPIREAT argument table */
|
||||||
struct redisCommandArg EXPIREAT_Args[] = {
|
struct redisCommandArg EXPIREAT_Args[] = {
|
||||||
{"key",ARG_TYPE_KEY,0,NULL,NULL,NULL,CMD_ARG_NONE},
|
{"key",ARG_TYPE_KEY,0,NULL,NULL,NULL,CMD_ARG_NONE},
|
||||||
{"timestamp",ARG_TYPE_UNIX_TIME,-1,NULL,NULL,NULL,CMD_ARG_NONE},
|
{"unix-time-seconds",ARG_TYPE_UNIX_TIME,-1,NULL,NULL,NULL,CMD_ARG_NONE},
|
||||||
{"condition",ARG_TYPE_ONEOF,-1,NULL,NULL,"7.0.0",CMD_ARG_OPTIONAL,.subargs=EXPIREAT_condition_Subargs},
|
{"condition",ARG_TYPE_ONEOF,-1,NULL,NULL,"7.0.0",CMD_ARG_OPTIONAL,.subargs=EXPIREAT_condition_Subargs},
|
||||||
{0}
|
{0}
|
||||||
};
|
};
|
||||||
@ -1494,7 +1494,7 @@ struct redisCommandArg PEXPIREAT_condition_Subargs[] = {
|
|||||||
/* PEXPIREAT argument table */
|
/* PEXPIREAT argument table */
|
||||||
struct redisCommandArg PEXPIREAT_Args[] = {
|
struct redisCommandArg PEXPIREAT_Args[] = {
|
||||||
{"key",ARG_TYPE_KEY,0,NULL,NULL,NULL,CMD_ARG_NONE},
|
{"key",ARG_TYPE_KEY,0,NULL,NULL,NULL,CMD_ARG_NONE},
|
||||||
{"milliseconds-timestamp",ARG_TYPE_UNIX_TIME,-1,NULL,NULL,NULL,CMD_ARG_NONE},
|
{"unix-time-milliseconds",ARG_TYPE_UNIX_TIME,-1,NULL,NULL,NULL,CMD_ARG_NONE},
|
||||||
{"condition",ARG_TYPE_ONEOF,-1,NULL,NULL,"7.0.0",CMD_ARG_OPTIONAL,.subargs=PEXPIREAT_condition_Subargs},
|
{"condition",ARG_TYPE_ONEOF,-1,NULL,NULL,"7.0.0",CMD_ARG_OPTIONAL,.subargs=PEXPIREAT_condition_Subargs},
|
||||||
{0}
|
{0}
|
||||||
};
|
};
|
||||||
@ -5947,7 +5947,7 @@ struct redisCommandArg XCLAIM_Args[] = {
|
|||||||
{"min-idle-time",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE},
|
{"min-idle-time",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE},
|
||||||
{"id",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_MULTIPLE},
|
{"id",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_MULTIPLE},
|
||||||
{"ms",ARG_TYPE_INTEGER,-1,"IDLE",NULL,NULL,CMD_ARG_OPTIONAL},
|
{"ms",ARG_TYPE_INTEGER,-1,"IDLE",NULL,NULL,CMD_ARG_OPTIONAL},
|
||||||
{"ms-unix-time",ARG_TYPE_INTEGER,-1,"TIME",NULL,NULL,CMD_ARG_OPTIONAL},
|
{"unix-time-milliseconds",ARG_TYPE_UNIX_TIME,-1,"TIME",NULL,NULL,CMD_ARG_OPTIONAL},
|
||||||
{"count",ARG_TYPE_INTEGER,-1,"RETRYCOUNT",NULL,NULL,CMD_ARG_OPTIONAL},
|
{"count",ARG_TYPE_INTEGER,-1,"RETRYCOUNT",NULL,NULL,CMD_ARG_OPTIONAL},
|
||||||
{"force",ARG_TYPE_PURE_TOKEN,-1,"FORCE",NULL,NULL,CMD_ARG_OPTIONAL},
|
{"force",ARG_TYPE_PURE_TOKEN,-1,"FORCE",NULL,NULL,CMD_ARG_OPTIONAL},
|
||||||
{"justid",ARG_TYPE_PURE_TOKEN,-1,"JUSTID",NULL,NULL,CMD_ARG_OPTIONAL},
|
{"justid",ARG_TYPE_PURE_TOKEN,-1,"JUSTID",NULL,NULL,CMD_ARG_OPTIONAL},
|
||||||
@ -6452,8 +6452,8 @@ struct redisCommandArg GETDEL_Args[] = {
|
|||||||
struct redisCommandArg GETEX_expiration_Subargs[] = {
|
struct redisCommandArg GETEX_expiration_Subargs[] = {
|
||||||
{"seconds",ARG_TYPE_INTEGER,-1,"EX",NULL,NULL,CMD_ARG_NONE},
|
{"seconds",ARG_TYPE_INTEGER,-1,"EX",NULL,NULL,CMD_ARG_NONE},
|
||||||
{"milliseconds",ARG_TYPE_INTEGER,-1,"PX",NULL,NULL,CMD_ARG_NONE},
|
{"milliseconds",ARG_TYPE_INTEGER,-1,"PX",NULL,NULL,CMD_ARG_NONE},
|
||||||
{"unix-time",ARG_TYPE_INTEGER,-1,"EXAT",NULL,NULL,CMD_ARG_NONE},
|
{"unix-time-seconds",ARG_TYPE_UNIX_TIME,-1,"EXAT",NULL,NULL,CMD_ARG_NONE},
|
||||||
{"unix-time",ARG_TYPE_INTEGER,-1,"PXAT",NULL,NULL,CMD_ARG_NONE},
|
{"unix-time-milliseconds",ARG_TYPE_UNIX_TIME,-1,"PXAT",NULL,NULL,CMD_ARG_NONE},
|
||||||
{"persist",ARG_TYPE_PURE_TOKEN,-1,"PERSIST",NULL,NULL,CMD_ARG_NONE},
|
{"persist",ARG_TYPE_PURE_TOKEN,-1,"PERSIST",NULL,NULL,CMD_ARG_NONE},
|
||||||
{0}
|
{0}
|
||||||
};
|
};
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
"key_spec_index": 0
|
"key_spec_index": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "timestamp",
|
"name": "unix-time-seconds",
|
||||||
"type": "unix-time"
|
"type": "unix-time"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -56,13 +56,13 @@
|
|||||||
"token": "PX"
|
"token": "PX"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "unix-time",
|
"name": "unix-time-seconds",
|
||||||
"type": "integer",
|
"type": "unix-time",
|
||||||
"token": "EXAT"
|
"token": "EXAT"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "unix-time",
|
"name": "unix-time-milliseconds",
|
||||||
"type": "integer",
|
"type": "unix-time",
|
||||||
"token": "PXAT"
|
"token": "PXAT"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
"key_spec_index": 0
|
"key_spec_index": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "milliseconds-timestamp",
|
"name": "unix-time-milliseconds",
|
||||||
"type": "unix-time"
|
"type": "unix-time"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -67,8 +67,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"token": "TIME",
|
"token": "TIME",
|
||||||
"name": "ms-unix-time",
|
"name": "unix-time-milliseconds",
|
||||||
"type": "integer",
|
"type": "unix-time",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user