Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
more tolerant cache and queue size
Browse files Browse the repository at this point in the history
  • Loading branch information
roberto@debian32 committed Aug 18, 2011
1 parent 0f31c21 commit 6f7054d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ void uwsgi_init_cache() {
if (!uwsgi.cache_blocksize)
uwsgi.cache_blocksize = UMAX16;

if (uwsgi.cache_blocksize % uwsgi.page_size != 0) {
if ((uwsgi.cache_blocksize * uwsgi.cache_max_items) % uwsgi.page_size != 0) {
uwsgi_log("invalid cache blocksize %llu: must be a multiple of memory page size (%d bytes)\n", (unsigned long long) uwsgi.cache_blocksize, uwsgi.page_size);
exit(1);
}
Expand Down
4 changes: 2 additions & 2 deletions queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ void uwsgi_init_queue() {
if (!uwsgi.queue_blocksize)
uwsgi.queue_blocksize = 8192;

if (uwsgi.queue_blocksize % uwsgi.page_size != 0) {
uwsgi_log("invalid queue blocksize %llu: must be a multiple of memory page size (%d bytes)\n", (unsigned long long) uwsgi.queue_blocksize, uwsgi.page_size);
if ((uwsgi.queue_blocksize * uwsgi.queue_size) % uwsgi.page_size != 0) {
uwsgi_log("invalid queue size/blocksize %llu: must be a multiple of memory page size (%d bytes)\n", (unsigned long long) uwsgi.queue_blocksize, uwsgi.page_size);
exit(1);
}

Expand Down

0 comments on commit 6f7054d

Please sign in to comment.