Skip to content

Instantly share code, notes, and snippets.

Created December 22, 2011 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1510453 to your computer and use it in GitHub Desktop.
Save anonymous/1510453 to your computer and use it in GitHub Desktop.
Object seq = ctx.get("seq");
String id = ctx.get("id").toString();
// Ignore design documents
if (id.startsWith("_design/")) {
if (logger.isTraceEnabled()) {
logger.trace("ignoring design document {}", id);
}
return seq;
}
if (script != null) {
script.setNextVar("ctx", ctx);
try {
script.run();
// we need to unwrap the ctx...
ctx = (Map<String, Object>) script.unwrap(ctx);
} catch (Exception e) {
logger.warn("failed to script process {}, ignoring", e, ctx);
return seq;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment