mt4-redis
mt4-redis copied to clipboard
遇到奇怪错误,HelloWorld报错,超时时间不能设置
运行test
1.Helloworld 报错没这个函数
2.另外redis数据可以插入,但是timeout数据丢失....
For integration testing, two test methods HelloWorld
and RedisTest
were implemented in c++ library and tested in test.mq4
. you can just simply delete them.
The HelloWorld
method is defined to return a string from c++ library as same as what input parameter string is.
And RedisTest
method is defined to check availability of Redis server, which connect to a exist server and do nothing.
In this library, we use a light library hiredis [url:https://github.com/redis/hiredis] as client for Redis.
Methods end with WithTimeout
were implemented to call redisConnectWithTimeout
in order to check connection healthy before redisCommand
is called.
In hiredis
, the default timeout parameter is 1000ms, this might cause timeout error when Redis connection situation is bad.
1.Use RedisGet
and RedisCommand
when Redis server is located in your intranet.
2.Correspondingly, Use RedisGetWithTimeout
and RedisCommandTimeout
when Redis server connection healthy/availability is not good.
Other Use EXPIRE and EXPIREAT command if you want to set an EXPIREable value.