From 07eb0963cae3a403f8774f65afa20c940ce7124f Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Fri, 13 Jun 2014 08:57:41 -0400
Subject: [PATCH] Merged #103 "flotr2 throws exception on small dashboards"

---
 src/main/java/com/gitblit/servlet/RpcServlet.java |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/gitblit/servlet/RpcServlet.java b/src/main/java/com/gitblit/servlet/RpcServlet.java
index 28f0d5b..2d59ebd 100644
--- a/src/main/java/com/gitblit/servlet/RpcServlet.java
+++ b/src/main/java/com/gitblit/servlet/RpcServlet.java
@@ -59,7 +59,7 @@
 
 	private static final long serialVersionUID = 1L;
 
-	public static final int PROTOCOL_VERSION = 6;
+	public static final int PROTOCOL_VERSION = 7;
 
 	private IStoredSettings settings;
 
@@ -383,6 +383,19 @@
 			} else {
 				response.sendError(notAllowedCode);
 			}
+		} else if (RpcRequest.REINDEX_TICKETS.equals(reqType)) {
+			if (allowManagement) {
+				if (StringUtils.isEmpty(objectName)) {
+					// reindex all tickets
+					gitblit.getTicketService().reindex();
+				} else {
+					// reindex tickets in a specific repository
+					RepositoryModel model = gitblit.getRepositoryModel(objectName);
+					gitblit.getTicketService().reindex(model);
+				}
+			} else {
+				response.sendError(notAllowedCode);
+			}
 		}
 
 		// send the result of the request

--
Gitblit v1.9.1