Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 8542fe7d authored by Marc Duez's avatar Marc Duez

server : sequence file size are stored as integer

parent c35278be
# coding: utf8
import gluon.contrib.simplejson
import os.path
import defs
if request.env.http_origin:
response.headers['Access-Control-Allow-Origin'] = request.env.http_origin
response.headers['Access-Control-Allow-Credentials'] = 'true'
......@@ -29,7 +29,7 @@ def repair_missing_files():
db.sequence_file[row.id] = dict(data_file = None)
flist += " : " + row.filename
else :
size = defs.format_size(os.path.getsize(seq_file))
size = os.path.getsize(seq_file)
db.sequence_file[row.id] = dict(size_file = size)
res = {"success" : "true", "message" : "path of missing files have been removed from the database"+flist}
......
......@@ -130,7 +130,7 @@ def upload():
mes = f.filename + ": upload finished"
seq_file = defs.DIR_SEQUENCES+db.sequence_file[request.vars["id"]].data_file
size = vidjil_utils.format_size(os.path.getsize(seq_file))
size = os.path.getsize(seq_file)
db.sequence_file[request.vars["id"]] = dict(size_file = size)
res = {"message": mes}
......
......@@ -113,7 +113,8 @@ db.define_table('sequence_file',
Field('pcr','text'),
Field('sequencer','text'),
Field('producer','text'),
Field('size_file','text'),
Field('size_file','integer', default=0),
Field('provider','reference auth_user'),
Field('data_file', 'upload',
uploadfolder=defs.DIR_SEQUENCES,
length=1000000000000, autodelete=True))
......
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