refactor: RUNTIME_MAX_TENANT_COUNT

master
Sean McBride 3 years ago
parent 41a087394e
commit a529db3430

@ -4,8 +4,6 @@
#include "module_database.h" #include "module_database.h"
#include "tcp_server.h" #include "tcp_server.h"
#define TENANT_DATABASE_CAPACITY 128
struct tenant { struct tenant {
char *name; char *name;
struct tcp_server tcp_server; struct tcp_server tcp_server;

@ -1,5 +1,6 @@
#include <errno.h> #include <errno.h>
#include "runtime.h"
#include "tenant.h" #include "tenant.h"
#include "panic.h" #include "panic.h"
@ -7,7 +8,7 @@
* Tenant Database * * Tenant Database *
******************/ ******************/
struct tenant *tenant_database[TENANT_DATABASE_CAPACITY] = { NULL }; struct tenant *tenant_database[RUNTIME_MAX_TENANT_COUNT] = { NULL };
size_t tenant_database_count = 0; size_t tenant_database_count = 0;
/** /**
@ -18,11 +19,11 @@ size_t tenant_database_count = 0;
int int
tenant_database_add(struct tenant *tenant) tenant_database_add(struct tenant *tenant)
{ {
assert(tenant_database_count <= TENANT_DATABASE_CAPACITY); assert(tenant_database_count <= RUNTIME_MAX_TENANT_COUNT);
int rc; int rc;
if (tenant_database_count == TENANT_DATABASE_CAPACITY) goto err_no_space; if (tenant_database_count == RUNTIME_MAX_TENANT_COUNT) goto err_no_space;
tenant_database[tenant_database_count++] = tenant; tenant_database[tenant_database_count++] = tenant;
rc = 0; rc = 0;

Loading…
Cancel
Save