[open-ils-commits] r7530 - in trunk/Open-ILS: examples src/c-apps
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Jul 6 12:24:54 EDT 2007
Author: miker
Date: 2007-07-06 12:20:53 -0400 (Fri, 06 Jul 2007)
New Revision: 7530
Modified:
trunk/Open-ILS/examples/opensrf.xml.example
trunk/Open-ILS/src/c-apps/oils_cstore.c
Log:
providing for "just flesh as deep as you can" functionallity with flesh == -1; in-code max of 1000, default configured max of 100
Modified: trunk/Open-ILS/examples/opensrf.xml.example
===================================================================
--- trunk/Open-ILS/examples/opensrf.xml.example 2007-07-06 16:20:07 UTC (rev 7529)
+++ trunk/Open-ILS/examples/opensrf.xml.example 2007-07-06 16:20:53 UTC (rev 7530)
@@ -519,7 +519,7 @@
<max_spare_children>5</max_spare_children>
</unix_config>
<app_settings>
- <IDL>/openils/conf/fm_IDL.xml</IDL> <!-- deprecated with 1.1.0-->
+ <max_query_recursion>100</max_query_recursion>
<driver>pgsql</driver>
<database>
<type>master</type>
@@ -605,18 +605,17 @@
<max_spare_children>5</max_spare_children>
</unix_config>
<app_settings>
- <IDL>/openils/conf/fm_IDL.xml</IDL> <!-- deprecated with 1.1.0 -->
- <driver>pgsql</driver>
- <database>
- <type>master</type>
- <weight>2</weight>
- <user>postgres</user>
- <host>localhost</host>
- <port>5432</port>
- <pw>postgres</pw>
- <db>evergreen</db>
- <client_encoding>UTF-8</client_encoding>
- </database>
+ <driver>pgsql</driver>
+ <database>
+ <type>master</type>
+ <weight>2</weight>
+ <user>postgres</user>
+ <host>localhost</host>
+ <port>5432</port>
+ <pw>postgres</pw>
+ <db>evergreen</db>
+ <client_encoding>UTF-8</client_encoding>
+ </database>
</app_settings>
</open-ils.reporter-store>
Modified: trunk/Open-ILS/src/c-apps/oils_cstore.c
===================================================================
--- trunk/Open-ILS/src/c-apps/oils_cstore.c 2007-07-06 16:20:07 UTC (rev 7529)
+++ trunk/Open-ILS/src/c-apps/oils_cstore.c 2007-07-06 16:20:53 UTC (rev 7530)
@@ -67,6 +67,7 @@
dbi_conn dbhandle; /* our CURRENT db connection */
osrfHash readHandles;
jsonObject* jsonNULL = NULL; //
+static int max_flesh_depth = 100;
/* called when this process is about to exit */
void osrfAppChildExit() {
@@ -224,6 +225,7 @@
char* port = osrf_settings_host_value("/apps/%s/app_settings/database/port", MODULENAME);
char* db = osrf_settings_host_value("/apps/%s/app_settings/database/db", MODULENAME);
char* pw = osrf_settings_host_value("/apps/%s/app_settings/database/pw", MODULENAME);
+ char* md = osrf_settings_host_value("/apps/%s/app_settings/max_query_recursion", MODULENAME);
osrfLogDebug(OSRF_LOG_MARK, "Attempting to load the database driver [%s]...", driver);
writehandle = dbi_conn_new(driver);
@@ -243,6 +245,10 @@
if(pw) dbi_conn_set_option(writehandle, "password", pw );
if(db) dbi_conn_set_option(writehandle, "dbname", db );
+ if(md) max_flesh_depth = atoi(md);
+ if(max_flesh_depth < 0) max_flesh_depth = 1;
+ if(max_flesh_depth > 1000) max_flesh_depth = 1000;
+
free(user);
free(host);
free(port);
@@ -2335,6 +2341,7 @@
_tmp = jsonObjectGetKey( order_hash, "flesh" );
if (_tmp) {
int x = (int)jsonObjectGetNumber(_tmp);
+ if (x == -1 || x > max_flesh_depth) x = max_flesh_depth;
jsonObject* flesh_blob = NULL;
if ((flesh_blob = jsonObjectGetKey( order_hash, "flesh_fields" )) && x > 0) {
More information about the open-ils-commits
mailing list