Skip to content

Commit eca0362

Browse files
committed
Modules: added state file for the shared dictionary.
A new optional state parameter is added for js_shared_dict_zone directive. state parameter specifies a file that keeps the current state of the shared dict in the JSON format and makes it persistent across nginx restarts. This closes #709 feature request on Github.
1 parent bc3b91c commit eca0362

File tree

7 files changed

+1534
-19
lines changed

7 files changed

+1534
-19
lines changed

nginx/ngx_http_js_module.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7738,6 +7738,10 @@ ngx_http_js_init_worker(ngx_cycle_t *cycle)
77387738
return NGX_ERROR;
77397739
}
77407740

7741+
if (ngx_js_dict_init_worker(jmcf) != NGX_OK) {
7742+
return NGX_ERROR;
7743+
}
7744+
77417745
return NGX_OK;
77427746
}
77437747

nginx/ngx_js.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
#include <njs.h>
1717
#include <njs_rbtree.h>
1818
#include <njs_arr.h>
19-
#include "ngx_js_fetch.h"
20-
#include "ngx_js_shared_dict.h"
2119

2220
#if (NJS_HAVE_QUICKJS)
2321
#include <qjs.h>
@@ -440,4 +438,7 @@ extern njs_module_t njs_xml_module;
440438
extern njs_module_t njs_zlib_module;
441439

442440

441+
#include "ngx_js_fetch.h"
442+
#include "ngx_js_shared_dict.h"
443+
443444
#endif /* _NGX_JS_H_INCLUDED_ */

0 commit comments

Comments
 (0)