我正在我的个人项目中设置新的 redis 服务器。
如果我不使用 EXPIRE 命令设置任何超时值,则 ttl 为 -1
我只是想知道 -1 是否意味着永久或默认过期超时。
如果设置键值设置 ttl -1 那么 PERSIST 命令的目的是什么
这是我的代码 这在输出控制台上给出了 30 次堆栈溢出错误
fun main(args:Array<String>){
var no:Int=Integer.parseInt(readLine())//read input from user and convert to Integer
var ans:Int=calculateFact(no) //call function and store to ans variable
println("Factorial of "+no+" is "+ans) //print result
}
fun calculateFact(no:Int):Int //function for recursion
{
if(no==0) {
return 1 }
return (no*calculateFact(no))
}
Run Code Online (Sandbox Code Playgroud)
我不知道什么是错误解决plz