Last active
December 15, 2015 19:49
-
-
Save isao/5314079 to your computer and use it in GitHub Desktop.
patch to dump resource store data to files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/app/autoload/store.server.js b/lib/app/autoload/store.server.js | |
index 8b01307..ac0e948 100644 | |
--- a/lib/app/autoload/store.server.js | |
+++ b/lib/app/autoload/store.server.js | |
@@ -407,8 +407,24 @@ YUI.add('mojito-resource-store', function(Y, NAME) { | |
this.resolveResourceVersions(); | |
Y.log('Store fully preloaded', 'info', NAME); | |
+ | |
+ this.dumpRs(); | |
}, | |
+ dumpRs: function() { | |
+ var fsws = require('fs').writeFileSync, | |
+ inspect = require('util').inspect; | |
+ | |
+ function insp(js) { | |
+ return inspect(js, false, 99, false); | |
+ } | |
+ | |
+ fsws('/tmp/getResourceVersions.js', insp(this.getResourceVersions({})), 'utf8'); | |
+ fsws('/tmp/getResources-client.js', insp(this.getResources('client', {}, {})), 'utf8'); | |
+ fsws('/tmp/getResources-server.js', insp(this.getResources('server', {}, {})), 'utf8'); | |
+ fsws('/tmp/this._appRVs.js', insp(this._appRVs), 'utf8'); | |
+ fsws('/tmp/this._mojitRVs.js', insp(this._mojitRVs), 'utf8'); | |
+ }, | |
/** | |
* Returns a list of resource versions that match the filter. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment