Commit 9ceac8f1 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Added node size in bytes as 'content_length' in file catalog.

parent a753edc9
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -225,8 +225,9 @@ class DbConnector(object):
                                 busy_state, 
                                 owner_id, 
                                 creator_id,
                                 content_length,
                                 content_md5)
                VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s);
                VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);
                """,
                (parentLtreePath,
                 parentLtreeRelativePath,
@@ -237,6 +238,7 @@ class DbConnector(object):
                 node.busyState,
                 node.ownerID,
                 node.creatorID,
                 node.contentLength,
                 node.contentMD5,))
            self.conn.commit()

+2 −0
Original line number Diff line number Diff line
@@ -163,6 +163,7 @@ class StorePreprocessor(TaskExecutor):
                cnode.setBusyState(True)
                cnode.setOwnerID(self.userId)
                cnode.setCreatorID(self.userId)
                cnode.setContentLength(0)
                if not self.dbConn.nodeExists(cnode):
                    self.dbConn.insertNode(cnode)
                    self.nodeList.append(basePath + '/' + nodeName)
@@ -191,6 +192,7 @@ class StorePreprocessor(TaskExecutor):
                    dnode.setBusyState(True)
                    dnode.setOwnerID(self.userId)
                    dnode.setCreatorID(self.userId)
                    dnode.setContentLength(os.path.getsize(file))
                    dnode.setContentMD5(self.md5calc.getMD5(file))
                    if not self.dbConn.nodeExists(dnode):
                        self.dbConn.insertNode(dnode)