Reduce logging and improve static files loading

Reduce logging so only anomalous situations result in log entries (you
can turn logging back on by setting appinventor.debugging to true in
appengine-web.xml).

Disable App Stats, as it really isn’t needed in production.

Provide reasonable caching and expiration on some static files,
including making sure they are served statically (this is required when
removing App Stats).

Change-Id: I84bd4877a2cbeba79f7da9248919920ea27c499b
parent e38f54e9
...@@ -20,6 +20,7 @@ import com.google.appengine.api.search.ScoredDocument; ...@@ -20,6 +20,7 @@ import com.google.appengine.api.search.ScoredDocument;
import com.google.appengine.api.search.SearchException; import com.google.appengine.api.search.SearchException;
import com.google.appengine.api.search.SearchServiceFactory; import com.google.appengine.api.search.SearchServiceFactory;
import com.google.appengine.api.search.StatusCode; import com.google.appengine.api.search.StatusCode;
import com.google.appinventor.server.flags.Flag;
import com.google.appinventor.server.storage.GalleryStorageIo; import com.google.appinventor.server.storage.GalleryStorageIo;
import com.google.appinventor.server.storage.GalleryStorageIoInstanceHolder; import com.google.appinventor.server.storage.GalleryStorageIoInstanceHolder;
import com.google.appinventor.shared.rpc.project.GalleryApp; import com.google.appinventor.shared.rpc.project.GalleryApp;
...@@ -42,6 +43,8 @@ public class GallerySearchIndex { ...@@ -42,6 +43,8 @@ public class GallerySearchIndex {
private static volatile GallerySearchIndex instance= null; private static volatile GallerySearchIndex instance= null;
private static final int SEARCH_RETRY_MAX = 3; private static final int SEARCH_RETRY_MAX = 3;
private final int NUMBER_FOUND_ACCURACY = 100; private final int NUMBER_FOUND_ACCURACY = 100;
private static final boolean DEBUG = Flag.createFlag("appinventor.debugging", false).get();
/** /**
* The default constructor of GallerySearchIndex * The default constructor of GallerySearchIndex
*/ */
...@@ -128,7 +131,9 @@ public class GallerySearchIndex { ...@@ -128,7 +131,9 @@ public class GallerySearchIndex {
boolean retry = true; boolean retry = true;
while (retry){ while (retry){
try { try {
if (DEBUG) {
LOG.info("Sending query " + query); LOG.info("Sending query " + query);
}
results = getIndex().search(query); results = getIndex().search(query);
// search successful // search successful
retry = false; retry = false;
...@@ -151,8 +156,10 @@ public class GallerySearchIndex { ...@@ -151,8 +156,10 @@ public class GallerySearchIndex {
if (results != null){ if (results != null){
// Iterate over the documents in the results // Iterate over the documents in the results
for (ScoredDocument document : results) { for (ScoredDocument document : results) {
if (DEBUG) {
LOG.info("Find:" + document.getId()); LOG.info("Find:" + document.getId());
} }
}
// Iterate over the documents in the results // Iterate over the documents in the results
for (ScoredDocument document : results) { for (ScoredDocument document : results) {
......
...@@ -26,6 +26,7 @@ import com.google.appengine.tools.cloudstorage.GcsFilename; ...@@ -26,6 +26,7 @@ import com.google.appengine.tools.cloudstorage.GcsFilename;
import com.google.appengine.tools.cloudstorage.GcsOutputChannel; import com.google.appengine.tools.cloudstorage.GcsOutputChannel;
import com.google.appengine.tools.cloudstorage.GcsService; import com.google.appengine.tools.cloudstorage.GcsService;
import com.google.appengine.tools.cloudstorage.GcsServiceFactory; import com.google.appengine.tools.cloudstorage.GcsServiceFactory;
import com.google.appinventor.server.flags.Flag;
import com.google.appinventor.server.util.CacheHeaders; import com.google.appinventor.server.util.CacheHeaders;
import com.google.appinventor.server.util.CacheHeadersImpl; import com.google.appinventor.server.util.CacheHeadersImpl;
import com.google.appinventor.shared.rpc.ServerLayout; import com.google.appinventor.shared.rpc.ServerLayout;
...@@ -70,7 +71,7 @@ public class GalleryServlet extends OdeServlet { ...@@ -70,7 +71,7 @@ public class GalleryServlet extends OdeServlet {
private static final String CONTENT_TYPE = "text/html; charset=utf-8"; private static final String CONTENT_TYPE = "text/html; charset=utf-8";
private final GalleryService galleryService = new GalleryServiceImpl(); private final GalleryService galleryService = new GalleryServiceImpl();
private static final boolean DEBUG = Flag.createFlag("appinventor.debugging", false).get();
@Override @Override
public void doPost(HttpServletRequest req, HttpServletResponse resp) { public void doPost(HttpServletRequest req, HttpServletResponse resp) {
...@@ -83,8 +84,10 @@ public class GalleryServlet extends OdeServlet { ...@@ -83,8 +84,10 @@ public class GalleryServlet extends OdeServlet {
if (true) { if (true) {
String requestType = uriComponents[REQUEST_TYPE_INDEX]; String requestType = uriComponents[REQUEST_TYPE_INDEX];
if (DEBUG) {
LOG.info("######### GOT IN URI"); LOG.info("######### GOT IN URI");
LOG.info(requestType); LOG.info(requestType);
}
long project_Id = -1; long project_Id = -1;
String user_Id = "-1"; String user_Id = "-1";
......
...@@ -73,6 +73,7 @@ public class LoginServlet extends HttpServlet { ...@@ -73,6 +73,7 @@ public class LoginServlet extends HttpServlet {
private static final Flag<Boolean> useLocal = Flag.createFlag("auth.uselocal", false); private static final Flag<Boolean> useLocal = Flag.createFlag("auth.uselocal", false);
private static final UserService userService = UserServiceFactory.getUserService(); private static final UserService userService = UserServiceFactory.getUserService();
private final PolicyFactory sanitizer = new HtmlPolicyBuilder().allowElements("p").toFactory(); private final PolicyFactory sanitizer = new HtmlPolicyBuilder().allowElements("p").toFactory();
private static final boolean DEBUG = Flag.createFlag("appinventor.debugging", false).get();
public void init(ServletConfig config) throws ServletException { public void init(ServletConfig config) throws ServletException {
super.init(config); super.init(config);
...@@ -83,7 +84,9 @@ public class LoginServlet extends HttpServlet { ...@@ -83,7 +84,9 @@ public class LoginServlet extends HttpServlet {
PrintWriter out; PrintWriter out;
String [] components = req.getRequestURI().split("/"); String [] components = req.getRequestURI().split("/");
if (DEBUG) {
LOG.info("requestURI = " + req.getRequestURI()); LOG.info("requestURI = " + req.getRequestURI());
}
String page = getPage(req); String page = getPage(req);
OdeAuthFilter.UserInfo userInfo = OdeAuthFilter.getUserInfo(req); OdeAuthFilter.UserInfo userInfo = OdeAuthFilter.getUserInfo(req);
...@@ -100,7 +103,9 @@ public class LoginServlet extends HttpServlet { ...@@ -100,7 +103,9 @@ public class LoginServlet extends HttpServlet {
String galleryId = params.get("galleryId"); String galleryId = params.get("galleryId");
String redirect = params.get("redirect"); String redirect = params.get("redirect");
if (DEBUG) {
LOG.info("locale = " + locale + " bundle: " + new Locale(locale)); LOG.info("locale = " + locale + " bundle: " + new Locale(locale));
}
ResourceBundle bundle = ResourceBundle.getBundle("com/google/appinventor/server/loginmessages", new Locale(locale)); ResourceBundle bundle = ResourceBundle.getBundle("com/google/appinventor/server/loginmessages", new Locale(locale));
if (page.equals("google")) { if (page.equals("google")) {
...@@ -124,7 +129,9 @@ public class LoginServlet extends HttpServlet { ...@@ -124,7 +129,9 @@ public class LoginServlet extends HttpServlet {
} }
String newCookie = userInfo.buildCookie(false); String newCookie = userInfo.buildCookie(false);
if (DEBUG) {
LOG.info("newCookie = " + newCookie); LOG.info("newCookie = " + newCookie);
}
if (newCookie != null) { if (newCookie != null) {
Cookie cook = new Cookie("AppInventor", newCookie); Cookie cook = new Cookie("AppInventor", newCookie);
cook.setPath("/"); cook.setPath("/");
...@@ -179,7 +186,9 @@ public class LoginServlet extends HttpServlet { ...@@ -179,7 +186,9 @@ public class LoginServlet extends HttpServlet {
fail(req, resp, "Invalid Set Password Link"); fail(req, resp, "Invalid Set Password Link");
return; return;
} }
if (DEBUG) {
LOG.info("setpw email = " + data.email); LOG.info("setpw email = " + data.email);
}
User user = storageIo.getUserFromEmail(data.email); User user = storageIo.getUserFromEmail(data.email);
userInfo = new OdeAuthFilter.UserInfo(); // Create new userInfo object userInfo = new OdeAuthFilter.UserInfo(); // Create new userInfo object
userInfo.setUserId(user.getUserId()); // This effectively logs us in! userInfo.setUserId(user.getUserId()); // This effectively logs us in!
...@@ -275,7 +284,9 @@ public class LoginServlet extends HttpServlet { ...@@ -275,7 +284,9 @@ public class LoginServlet extends HttpServlet {
ResourceBundle bundle = ResourceBundle.getBundle("com/google/appinventor/server/loginmessages", new Locale(locale)); ResourceBundle bundle = ResourceBundle.getBundle("com/google/appinventor/server/loginmessages", new Locale(locale));
if (DEBUG) {
LOG.info("locale = " + locale + " bundle: " + new Locale(locale)); LOG.info("locale = " + locale + " bundle: " + new Locale(locale));
}
if (page.equals("sendlink")) { if (page.equals("sendlink")) {
String email = params.get("email"); String email = params.get("email");
if (email == null) { if (email == null) {
...@@ -346,11 +357,15 @@ public class LoginServlet extends HttpServlet { ...@@ -346,11 +357,15 @@ public class LoginServlet extends HttpServlet {
return; return;
} }
if (DEBUG) {
LOG.info("userInfo = " + userInfo + " user = " + user); LOG.info("userInfo = " + userInfo + " user = " + user);
}
userInfo.setUserId(user.getUserId()); userInfo.setUserId(user.getUserId());
userInfo.setIsAdmin(user.getIsAdmin()); userInfo.setIsAdmin(user.getIsAdmin());
String newCookie = userInfo.buildCookie(false); String newCookie = userInfo.buildCookie(false);
if (DEBUG) {
LOG.info("newCookie = " + newCookie); LOG.info("newCookie = " + newCookie);
}
if (newCookie != null) { if (newCookie != null) {
Cookie cook = new Cookie("AppInventor", newCookie); Cookie cook = new Cookie("AppInventor", newCookie);
cook.setPath("/"); cook.setPath("/");
......
...@@ -68,6 +68,7 @@ public class OdeAuthFilter implements Filter { ...@@ -68,6 +68,7 @@ public class OdeAuthFilter implements Filter {
static final Flag<Integer> renewTime = Flag.createFlag("session.renew", 30); static final Flag<Integer> renewTime = Flag.createFlag("session.renew", 30);
private final LocalUser localUser = LocalUser.getInstance(); private final LocalUser localUser = LocalUser.getInstance();
private static final boolean DEBUG = Flag.createFlag("appinventor.debugging", false).get();
/** /**
* Filters using Google Accounts * Filters using Google Accounts
...@@ -100,14 +101,18 @@ public class OdeAuthFilter implements Filter { ...@@ -100,14 +101,18 @@ public class OdeAuthFilter implements Filter {
// Use Local Authentication // Use Local Authentication
UserInfo userInfo = getUserInfo(httpRequest); UserInfo userInfo = getUserInfo(httpRequest);
if (userInfo == null) { // Invalid Login if (userInfo == null) { // Invalid Login
if (DEBUG) {
LOG.info("uinfo is null on login."); LOG.info("uinfo is null on login.");
}
// If the URI starts with /ode, then we are being invoked through // If the URI starts with /ode, then we are being invoked through
// the App Inventor client. In that case we are in an XMLHttpRequest // the App Inventor client. In that case we are in an XMLHttpRequest
// (aka ajax) so we cannot send a redirect to the login page // (aka ajax) so we cannot send a redirect to the login page
// instead we return SC_PRECONDITION_FAILED which tips off the // instead we return SC_PRECONDITION_FAILED which tips off the
// client that it needs to reload itself to the login page. // client that it needs to reload itself to the login page.
String uri = httpRequest.getRequestURI(); String uri = httpRequest.getRequestURI();
if (DEBUG) {
LOG.info("Not Logged In: uri = " + uri); LOG.info("Not Logged In: uri = " + uri);
}
if (uri.startsWith("/ode")) { if (uri.startsWith("/ode")) {
httpResponse.setStatus(HttpServletResponse.SC_PRECONDITION_FAILED); httpResponse.setStatus(HttpServletResponse.SC_PRECONDITION_FAILED);
} else { } else {
...@@ -164,7 +169,9 @@ public class OdeAuthFilter implements Filter { ...@@ -164,7 +169,9 @@ public class OdeAuthFilter implements Filter {
String newCookie = userInfo.buildCookie(true); String newCookie = userInfo.buildCookie(true);
if (newCookie != null) { // If we get a value here, it is time to renew if (newCookie != null) { // If we get a value here, it is time to renew
// the Cookie // the Cookie
if (DEBUG) {
LOG.info("Renewing the authentication Cookie"); LOG.info("Renewing the authentication Cookie");
}
Cookie cook = new Cookie("AppInventor", newCookie); Cookie cook = new Cookie("AppInventor", newCookie);
cook.setPath("/"); cook.setPath("/");
response.addCookie(cook); response.addCookie(cook);
...@@ -330,7 +337,9 @@ public class OdeAuthFilter implements Filter { ...@@ -330,7 +337,9 @@ public class OdeAuthFilter implements Filter {
for (Cookie cookie : cookies) { for (Cookie cookie : cookies) {
if ("AppInventor".equals(cookie.getName())) { if ("AppInventor".equals(cookie.getName())) {
String rawData = cookie.getValue(); String rawData = cookie.getValue();
if (DEBUG) {
LOG.info("getUserInfo: rawCookie = " + rawData); LOG.info("getUserInfo: rawCookie = " + rawData);
}
Crypter crypter = getCrypter(); Crypter crypter = getCrypter();
CookieAuth.cookie cookieToken = CookieAuth.cookie.parseFrom( CookieAuth.cookie cookieToken = CookieAuth.cookie.parseFrom(
crypter.decrypt(Base64Coder.decode(rawData))); crypter.decrypt(Base64Coder.decode(rawData)));
......
...@@ -64,6 +64,8 @@ public class ProjectServiceImpl extends OdeRemoteServiceServlet implements Proje ...@@ -64,6 +64,8 @@ public class ProjectServiceImpl extends OdeRemoteServiceServlet implements Proje
private final transient YoungAndroidProjectService youngAndroidProject = private final transient YoungAndroidProjectService youngAndroidProject =
new YoungAndroidProjectService(storageIo); new YoungAndroidProjectService(storageIo);
private static final boolean DEBUG = Flag.createFlag("appinventor.debugging", false).get();
/** /**
* Creates a new project. * Creates a new project.
* @param projectType type of new project * @param projectType type of new project
...@@ -601,7 +603,9 @@ public class ProjectServiceImpl extends OdeRemoteServiceServlet implements Proje ...@@ -601,7 +603,9 @@ public class ProjectServiceImpl extends OdeRemoteServiceServlet implements Proje
GcsService fileService = GcsServiceFactory.createGcsService(); GcsService fileService = GcsServiceFactory.createGcsService();
GcsFilename readableFile = new GcsFilename(Flag.createFlag("gallery.bucket", "").get(), galleryPath); GcsFilename readableFile = new GcsFilename(Flag.createFlag("gallery.bucket", "").get(), galleryPath);
GcsInputChannel readChannel = fileService.openPrefetchingReadChannel(readableFile, 0, 16384); GcsInputChannel readChannel = fileService.openPrefetchingReadChannel(readableFile, 0, 16384);
if (DEBUG) {
LOG.log(Level.INFO, "#### in newProjectFromGallery, past readChannel"); LOG.log(Level.INFO, "#### in newProjectFromGallery, past readChannel");
}
InputStream gcsis = Channels.newInputStream(readChannel); InputStream gcsis = Channels.newInputStream(readChannel);
// ok, we don't want to send the gcs stream because it can time out as we // ok, we don't want to send the gcs stream because it can time out as we
// process the zip. We need to copy to a byte buffer first, then send a bytestream // process the zip. We need to copy to a byte buffer first, then send a bytestream
...@@ -615,7 +619,9 @@ public class ProjectServiceImpl extends OdeRemoteServiceServlet implements Proje ...@@ -615,7 +619,9 @@ public class ProjectServiceImpl extends OdeRemoteServiceServlet implements Proje
} }
InputStream bais = new ByteArrayInputStream(bao.toByteArray()); InputStream bais = new ByteArrayInputStream(bao.toByteArray());
if (DEBUG) {
LOG.log(Level.INFO, "#### in newProjectFromGallery, past newInputStream"); LOG.log(Level.INFO, "#### in newProjectFromGallery, past newInputStream");
}
// close the gcs // close the gcs
readChannel.close(); readChannel.close();
...@@ -623,7 +629,9 @@ public class ProjectServiceImpl extends OdeRemoteServiceServlet implements Proje ...@@ -623,7 +629,9 @@ public class ProjectServiceImpl extends OdeRemoteServiceServlet implements Proje
FileImporter fileImporter = new FileImporterImpl(); FileImporter fileImporter = new FileImporterImpl();
UserProject userProject = fileImporter.importProject(userInfoProvider.getUserId(), UserProject userProject = fileImporter.importProject(userInfoProvider.getUserId(),
projectName, bais); projectName, bais);
if (DEBUG) {
LOG.log(Level.INFO, "#### in newProjectFromGallery, past importProject"); LOG.log(Level.INFO, "#### in newProjectFromGallery, past importProject");
}
// set the attribution id of the project // set the attribution id of the project
storageIo.setProjectAttributionId(userInfoProvider.getUserId(), userProject.getProjectId(),galleryId); storageIo.setProjectAttributionId(userInfoProvider.getUserId(), userProject.getProjectId(),galleryId);
...@@ -655,15 +663,12 @@ public class ProjectServiceImpl extends OdeRemoteServiceServlet implements Proje ...@@ -655,15 +663,12 @@ public class ProjectServiceImpl extends OdeRemoteServiceServlet implements Proje
private void validateSessionId(String sessionId) throws InvalidSessionException { private void validateSessionId(String sessionId) throws InvalidSessionException {
String storedSessionId = userInfoProvider.getSessionId(); String storedSessionId = userInfoProvider.getSessionId();
if (DEBUG) {
if (storedSessionId == null) { if (storedSessionId == null) {
LOG.info("storedSessionId is null"); LOG.info("storedSessionId is null");
} else { } else {
LOG.info("storedSessionId = " + storedSessionId); LOG.info("storedSessionId = " + storedSessionId);
} }
if (sessionId == null) {
LOG.info("sessionId is null");
} else {
LOG.info("sessionId = " + sessionId);
} }
if (sessionId.equals("force")) { // If we are forcing our way -- no check if (sessionId.equals("force")) { // If we are forcing our way -- no check
return; return;
......
...@@ -119,6 +119,7 @@ public final class YoungAndroidProjectService extends CommonProjectService { ...@@ -119,6 +119,7 @@ public final class YoungAndroidProjectService extends CommonProjectService {
// host[:port] to tell build server app host url // host[:port] to tell build server app host url
private static final Flag<String> appengineHost = private static final Flag<String> appengineHost =
Flag.createFlag("appengine.host", ""); Flag.createFlag("appengine.host", "");
private static final boolean DEBUG = Flag.createFlag("appinventor.debugging", false).get();
public YoungAndroidProjectService(StorageIo storageIo) { public YoungAndroidProjectService(StorageIo storageIo) {
super(YoungAndroidProjectNode.YOUNG_ANDROID_PROJECT_TYPE, storageIo); super(YoungAndroidProjectNode.YOUNG_ANDROID_PROJECT_TYPE, storageIo);
...@@ -777,7 +778,9 @@ public final class YoungAndroidProjectService extends CommonProjectService { ...@@ -777,7 +778,9 @@ public final class YoungAndroidProjectService extends CommonProjectService {
try { try {
String content = readContent(connection.getInputStream()); String content = readContent(connection.getInputStream());
if (content != null && !content.isEmpty()) { if (content != null && !content.isEmpty()) {
if (DEBUG) {
LOG.info("The current progress is " + content + "%."); LOG.info("The current progress is " + content + "%.");
}
currentProgress = Integer.parseInt(content); currentProgress = Integer.parseInt(content);
} }
} catch (IOException e) { } catch (IOException e) {
......
...@@ -129,6 +129,7 @@ public class ObjectifyStorageIo implements StorageIo { ...@@ -129,6 +129,7 @@ public class ObjectifyStorageIo implements StorageIo {
private final boolean useGcs = Flag.createFlag("use.gcs", true).get(); private final boolean useGcs = Flag.createFlag("use.gcs", true).get();
private final boolean conversionEnabled = false; // We are converting GCS <=> Blobstore private final boolean conversionEnabled = false; // We are converting GCS <=> Blobstore
private static final boolean DEBUG = Flag.createFlag("appinventor.debugging", false).get();
// Use this class to define the work of a job that can be // Use this class to define the work of a job that can be
// retried. The "datastore" argument to run() is the Objectify // retried. The "datastore" argument to run() is the Objectify
...@@ -217,12 +218,14 @@ public class ObjectifyStorageIo implements StorageIo { ...@@ -217,12 +218,14 @@ public class ObjectifyStorageIo implements StorageIo {
RetryParams retryParams = new RetryParams.Builder().initialRetryDelayMillis(100) RetryParams retryParams = new RetryParams.Builder().initialRetryDelayMillis(100)
.retryMaxAttempts(10) .retryMaxAttempts(10)
.totalRetryPeriodMillis(10000).build(); .totalRetryPeriodMillis(10000).build();
if (DEBUG) {
LOG.log(Level.INFO, "RetryParams: getInitialRetryDelayMillis() = " + retryParams.getInitialRetryDelayMillis()); LOG.log(Level.INFO, "RetryParams: getInitialRetryDelayMillis() = " + retryParams.getInitialRetryDelayMillis());
LOG.log(Level.INFO, "RetryParams: getRequestTimeoutMillis() = " + retryParams.getRequestTimeoutMillis()); LOG.log(Level.INFO, "RetryParams: getRequestTimeoutMillis() = " + retryParams.getRequestTimeoutMillis());
LOG.log(Level.INFO, "RetryParams: getRetryDelayBackoffFactor() = " + retryParams.getRetryDelayBackoffFactor()); LOG.log(Level.INFO, "RetryParams: getRetryDelayBackoffFactor() = " + retryParams.getRetryDelayBackoffFactor());
LOG.log(Level.INFO, "RetryParams: getRetryMaxAttempts() = " + retryParams.getRetryMaxAttempts()); LOG.log(Level.INFO, "RetryParams: getRetryMaxAttempts() = " + retryParams.getRetryMaxAttempts());
LOG.log(Level.INFO, "RetryParams: getRetryMinAttempts() = " + retryParams.getRetryMinAttempts()); LOG.log(Level.INFO, "RetryParams: getRetryMinAttempts() = " + retryParams.getRetryMinAttempts());
LOG.log(Level.INFO, "RetryParams: getTotalRetryPeriodMillis() = " + retryParams.getTotalRetryPeriodMillis()); LOG.log(Level.INFO, "RetryParams: getTotalRetryPeriodMillis() = " + retryParams.getTotalRetryPeriodMillis());
}
gcsService = GcsServiceFactory.createGcsService(retryParams); gcsService = GcsServiceFactory.createGcsService(retryParams);
memcache.setErrorHandler(ErrorHandlers.getConsistentLogAndContinue(Level.INFO)); memcache.setErrorHandler(ErrorHandlers.getConsistentLogAndContinue(Level.INFO));
initMotd(); initMotd();
...@@ -1541,8 +1544,10 @@ public class ObjectifyStorageIo implements StorageIo { ...@@ -1541,8 +1544,10 @@ public class ObjectifyStorageIo implements StorageIo {
if (fd == null) { if (fd == null) {
fd = datastore.find(projectFileKey(projectKey(projectId), fileName)); fd = datastore.find(projectFileKey(projectKey(projectId), fileName));
} else { } else {
if (DEBUG) {
LOG.log(Level.INFO, "Fetched " + key.getString() + " from memcache."); LOG.log(Level.INFO, "Fetched " + key.getString() + " from memcache.");
} }
}
// <Screen>.yail files are missing when user converts AI1 project to AI2 // <Screen>.yail files are missing when user converts AI1 project to AI2
// instead of blowing up, just create a <Screen>.yail file // instead of blowing up, just create a <Screen>.yail file
...@@ -1821,9 +1826,11 @@ public class ObjectifyStorageIo implements StorageIo { ...@@ -1821,9 +1826,11 @@ public class ObjectifyStorageIo implements StorageIo {
while (bytesRead < fileSize) { while (bytesRead < fileSize) {
bytesRead += readChannel.read(resultBuffer); bytesRead += readChannel.read(resultBuffer);
if (bytesRead < fileSize) { if (bytesRead < fileSize) {
if (DEBUG) {
LOG.log(Level.INFO, "readChannel: bytesRead = " + bytesRead + " fileSize = " + fileSize); LOG.log(Level.INFO, "readChannel: bytesRead = " + bytesRead + " fileSize = " + fileSize);
} }
} }
}
recovered = true; recovered = true;
result.t = resultBuffer.array(); result.t = resultBuffer.array();
// Should we downgrade to the blobstore (for debugging)? // Should we downgrade to the blobstore (for debugging)?
...@@ -2051,9 +2058,11 @@ public class ObjectifyStorageIo implements StorageIo { ...@@ -2051,9 +2058,11 @@ public class ObjectifyStorageIo implements StorageIo {
while (bytesRead < fileSize) { while (bytesRead < fileSize) {
bytesRead += readChannel.read(resultBuffer); bytesRead += readChannel.read(resultBuffer);
if (bytesRead < fileSize) { if (bytesRead < fileSize) {
if (DEBUG) {
LOG.log(Level.INFO, "readChannel: bytesRead = " + bytesRead + " fileSize = " + fileSize); LOG.log(Level.INFO, "readChannel: bytesRead = " + bytesRead + " fileSize = " + fileSize);
} }
} }
}
recovered = true; recovered = true;
data = resultBuffer.array(); data = resultBuffer.array();
break; // We got the data, break out of the loop! break; // We got the data, break out of the loop!
......
...@@ -13,6 +13,16 @@ ...@@ -13,6 +13,16 @@
</include> </include>
<include path="/media/*" expiration="365d" /> <include path="/media/*" expiration="365d" />
<include path="/images/*" expiration="365d" /> <include path="/images/*" expiration="365d" />
<include path="/Ya_tos_form.html" expiration="1d" />
<include path="/favicon.ico" expiration="365d" />
<include path="/gwt.css" expiration="1d" />
<include path="/Ya.css" expiration="1d" />
<include path="/templates/**" expiration="1d" />
<include path="/closure-library/closure/goog/base.js" expiration="1d" />
<include path="/closure-library/closure/goog/css/dialog.css" expiration="1d" />
<include path="/closure-library/closure/goog/deps.js" expiration="1d" />
<include path="/robots.txt" expiration="30d" />
<!-- These are not cached on purpose --> <!-- These are not cached on purpose -->
<include path="/ode/**.nocache.*" expiration="0s" /> <include path="/ode/**.nocache.*" expiration="0s" />
<include path="/blocklyframe.html" expiration="0s" /> <include path="/blocklyframe.html" expiration="0s" />
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
explicitly list all the ones we do want, which seems explicitly list all the ones we do want, which seems
error-prone. error-prone.
--> -->
<!-- App Stats Disabled
<filter> <filter>
<filter-name>appstats</filter-name> <filter-name>appstats</filter-name>
<filter-class>com.google.appengine.tools.appstats.AppstatsFilter</filter-class> <filter-class>com.google.appengine.tools.appstats.AppstatsFilter</filter-class>
...@@ -30,7 +31,7 @@ ...@@ -30,7 +31,7 @@
<filter-name>appstats</filter-name> <filter-name>appstats</filter-name>
<url-pattern>/*</url-pattern> <url-pattern>/*</url-pattern>
</filter-mapping> </filter-mapping>
-->
<!-- Security constraints: require login for these urls --> <!-- Security constraints: require login for these urls -->
<!-- This is how we implement Google Account login --> <!-- This is how we implement Google Account login -->
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment