window.showOpenFilePicker, window.showSaveFilePicker, window.showDirectoryPicker API 只能由用户行为触发, 程序主动调用报安全错误 SecurityError: Failed to execute ‘showDirectoryPicker’ on ‘Window’: Must be handling a user gesture to show a file picker.
127.0.0.1:6379> FUNCTION help 1) FUNCTION <subcommand> [<arg> [value] [opt] ...]. Subcommands are: 2) LOAD [REPLACE] <FUNCTION CODE> 3) Create a new library with the given library name and code. 4) DELETE <LIBRARY NAME> 5) Delete the given library. 6) LIST [LIBRARYNAME PATTERN] [WITHCODE] 7) Return general information on all the libraries: 8) * Library name 9) * The engine used to run the Library 10) * Library description 11) * Functions list 12) * Library code (if WITHCODE is given) 13) It also possible to get only function that matches a pattern using LIBRARYNAME argument. 14) STATS 15) Return information about the current function running: 16) * Function name 17) * Command used to run the function 18) * Duration in MS that the function is running 19) If no function is running, return nil 20) In addition, returns a list of available engines. 21) KILL 22) Kill the current running function. 23) FLUSH [ASYNC|SYNC] 24) Delete all the libraries. 25) When called without the optional mode argument, the behavior is determined by the 26) lazyfree-lazy-user-flush configuration directive. Valid modes are: 27) * ASYNC: Asynchronously flush the libraries. 28) * SYNC: Synchronously flush the libraries. 29) DUMP 30) Return a serialized payload representing the current libraries, can be restored using FUNCTION RESTORE command 31) RESTORE <PAYLOAD> [FLUSH|APPEND|REPLACE] 32) Restore the libraries represented by the given payload, it is possible to give a restore policy to 33) control how to handle existing libraries (default APPEND): 34) * FLUSH: delete all existing libraries. 35) * APPEND: appends the restored libraries to the existing libraries. On collision, abort. 36) * REPLACE: appends the restored libraries to the existing libraries, On collision, replace the old 37) libraries with the new libraries (notice that even on this option there is a chance of failure 38) incase of functions name collision with another library). 39) HELP 40) Prints this help.
127.0.0.1:6379> SET age 18 OK 127.0.0.1:6379> EXPIRE age 100 (integer) 1 127.0.0.1:6379> TTL age (integer) 98 127.0.0.1:6379> SET age 20 OK 127.0.0.1:6379> TTL age (integer) -1
# 使用 KEEPTTL 保留 key 关联的生存时间 127.0.0.1:6379> SET age 18 EX 100 OK 127.0.0.1:6379> TTL age (integer) 98 127.0.0.1:6379> SET age 20 KEEPTTL OK 127.0.0.1:6379> GET age "20" 127.0.0.1:6379> TTL age (integer) 79