From 4eb02623e7e3f197504ae75fcef2d3f3d82bbb33 Mon Sep 17 00:00:00 2001 From: Menci Date: Sat, 3 Dec 2016 10:07:18 +0800 Subject: [PATCH] Fix http or database error on long code or compiler output --- app.js | 3 ++- models/judge_state.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 1f5ca92..f80dfa2 100644 --- a/app.js +++ b/app.js @@ -49,7 +49,8 @@ global.syzoj = { // Use body parser let bodyParser = require('body-parser'); app.use(bodyParser.urlencoded({ - extended: true + extended: true, + limit: '10mb' })); app.use(bodyParser.json()); diff --git a/models/judge_state.js b/models/judge_state.js index 3737da9..aa24b5f 100644 --- a/models/judge_state.js +++ b/models/judge_state.js @@ -27,12 +27,12 @@ let Problem = syzoj.model('problem'); let model = db.define('judge_state', { id: { type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true }, - code: { type: Sequelize.TEXT }, + code: { type: Sequelize.TEXT('medium') }, language: { type: Sequelize.STRING(20) }, status: { type: Sequelize.STRING(50) }, score: { type: Sequelize.INTEGER }, - result: { type: Sequelize.TEXT, json: true }, + result: { type: Sequelize.TEXT('medium'), json: true }, user_id: { type: Sequelize.INTEGER,