Browse Source

Fix http or database error on long code or compiler output

master
Menci 8 years ago
parent
commit
4eb02623e7
  1. 3
      app.js
  2. 4
      models/judge_state.js

3
app.js

@ -49,7 +49,8 @@ global.syzoj = {
// Use body parser // Use body parser
let bodyParser = require('body-parser'); let bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({ app.use(bodyParser.urlencoded({
extended: true extended: true,
limit: '10mb'
})); }));
app.use(bodyParser.json()); app.use(bodyParser.json());

4
models/judge_state.js

@ -27,12 +27,12 @@ let Problem = syzoj.model('problem');
let model = db.define('judge_state', { let model = db.define('judge_state', {
id: { type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true }, id: { type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true },
code: { type: Sequelize.TEXT }, code: { type: Sequelize.TEXT('medium') },
language: { type: Sequelize.STRING(20) }, language: { type: Sequelize.STRING(20) },
status: { type: Sequelize.STRING(50) }, status: { type: Sequelize.STRING(50) },
score: { type: Sequelize.INTEGER }, score: { type: Sequelize.INTEGER },
result: { type: Sequelize.TEXT, json: true }, result: { type: Sequelize.TEXT('medium'), json: true },
user_id: { user_id: {
type: Sequelize.INTEGER, type: Sequelize.INTEGER,

Loading…
Cancel
Save