File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -174,17 +174,22 @@ class ListModules(tornado.web.RequestHandler):
174
174
global loaded_modules
175
175
global mhandlers
176
176
177
+ _cached_json = None
178
+
177
179
def get (self ):
178
- ret = []
179
- for module_name in loaded_modules :
180
- ret .append ({
181
- 'name' : module_name ,
182
- 'type' : mhandlers ['type:' + module_name ],
183
- 'mispattributes' : mhandlers [module_name ].introspection (),
184
- 'meta' : mhandlers [module_name ].version ()
185
- })
180
+ if not self ._cached_json :
181
+ ret = []
182
+ for module_name in loaded_modules :
183
+ ret .append ({
184
+ 'name' : module_name ,
185
+ 'type' : mhandlers ['type:' + module_name ],
186
+ 'mispattributes' : mhandlers [module_name ].introspection (),
187
+ 'meta' : mhandlers [module_name ].version ()
188
+ })
189
+ self ._cached_json = json .dumps (ret )
190
+
186
191
log .debug ('MISP ListModules request' )
187
- self .write (json . dumps ( ret ) )
192
+ self .write (self . _cached_json )
188
193
189
194
190
195
class QueryModule (tornado .web .RequestHandler ):
You can’t perform that action at this time.
0 commit comments