Lines Matching defs:env

182 redis_init(struct module_env* env, struct cachedb_env* cachedb_env)
194 moddata->numctxs = env->cfg->num_threads;
198 moddata->server_host = env->cfg->redis_server_host;
199 moddata->replica_server_host = env->cfg->redis_replica_server_host;
201 moddata->server_port = env->cfg->redis_server_port;
202 moddata->replica_server_port = env->cfg->redis_replica_server_port;
204 moddata->server_path = env->cfg->redis_server_path;
205 moddata->replica_server_path = env->cfg->redis_replica_server_path;
207 moddata->server_password = env->cfg->redis_server_password;
208 moddata->replica_server_password = env->cfg->redis_replica_server_password;
211 env->cfg->redis_timeout,
212 env->cfg->redis_command_timeout);
214 env->cfg->redis_replica_timeout,
215 env->cfg->redis_replica_command_timeout);
217 env->cfg->redis_timeout,
218 env->cfg->redis_connect_timeout);
220 env->cfg->redis_replica_timeout,
221 env->cfg->redis_replica_connect_timeout);
223 moddata->logical_db = env->cfg->redis_logical_db;
224 moddata->replica_logical_db = env->cfg->redis_replica_logical_db;
226 moddata->ctxs = calloc(env->cfg->num_threads, sizeof(redisContext*));
234 moddata->replica_ctxs = calloc(env->cfg->num_threads, sizeof(redisContext*));
277 if(env->cfg->redis_expire_records &&
278 moddata->ctxs[env->alloc->thread_num] != NULL) {
282 rep = redis_command(env, cachedb_env,
312 redis_deinit(struct module_env* env, struct cachedb_env* cachedb_env)
316 (void)env;
335 redis_command(struct module_env* env, struct cachedb_env* cachedb_env,
343 /* We assume env->alloc->thread_num is a unique ID for each thread
348 log_assert(env->alloc->thread_num < d->numctxs);
353 ctx = ctx_selector[env->alloc->thread_num];
378 ctx_selector[env->alloc->thread_num] = ctx;
390 ctx_selector[env->alloc->thread_num] = NULL;
404 redis_lookup(struct module_env* env, struct cachedb_env* cachedb_env,
420 rep = redis_command(env, cachedb_env, cmdbuf, NULL, 0, 0);
452 redis_store(struct module_env* env, struct cachedb_env* cachedb_env,
460 env->cfg->redis_expire_records &&
461 (!env->cfg->serve_expired || env->cfg->serve_expired_ttl > 0));
484 ttl += env->cfg->serve_expired_ttl;
498 rep = redis_command(env, cachedb_env, cmdbuf, data, data_len, 1);