From 603ac92013a0f89c58df4820a339b382064182ab Mon Sep 17 00:00:00 2001 From: konovalovsergey Date: Tue, 10 Jan 2017 16:43:50 +0300 Subject: [PATCH 1/2] problem with connections are closed before full opening --- DocService/sources/DocsCoServer.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DocService/sources/DocsCoServer.js b/DocService/sources/DocsCoServer.js index 9022d767..b8df01a0 100644 --- a/DocService/sources/DocsCoServer.js +++ b/DocService/sources/DocsCoServer.js @@ -1694,6 +1694,10 @@ exports.install = function(server, callbackFunction) { var res = true; var docId = conn.docId; var tmpUser = conn.user; + if (constants.CONN_CLOSED === conn.readyState) { + //closing could happen during async action + return false; + } connections.push(conn); yield* updatePresence(docId, tmpUser.id, getConnectionInfo(conn)); var firstParticipantNoView, countNoView = 0; From 334dfc43039e2c8e08119a0fe7133ec4933cbe9b Mon Sep 17 00:00:00 2001 From: "Alexey.Golubev" Date: Wed, 11 Jan 2017 12:31:36 +0300 Subject: [PATCH 2/2] Removed the drop tables into the separeted script --- schema/postgresql/createdb.sql | 11 ----------- schema/postgresql/removetbl.sql | 10 ++++++++++ 2 files changed, 10 insertions(+), 11 deletions(-) create mode 100644 schema/postgresql/removetbl.sql diff --git a/schema/postgresql/createdb.sql b/schema/postgresql/createdb.sql index b91b38fd..df297df8 100644 --- a/schema/postgresql/createdb.sql +++ b/schema/postgresql/createdb.sql @@ -4,13 +4,6 @@ -- CREATE DATABASE onlyoffice ENCODING = 'UTF8' CONNECTION LIMIT = -1; --- --- Drop tables --- -DROP TABLE IF EXISTS "public"."doc_callbacks"; -DROP TABLE IF EXISTS "public"."doc_changes"; -DROP TABLE IF EXISTS "public"."task_result"; - -- ---------------------------- -- Table structure for doc_callbacks -- ---------------------------- @@ -52,10 +45,6 @@ PRIMARY KEY ("id") ) WITH (OIDS=FALSE); ---https://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#PLPGSQL-UPSERT-EXAMPLE -DROP FUNCTION IF EXISTS merge_db(_id varchar(255), _status int2, _status_info int8, _last_open_date timestamp without time zone, _title varchar(255), _user_index int8, _change_id int8, OUT isupdate char(5), OUT userindex int8) CASCADE; -DROP FUNCTION IF EXISTS merge_db(_id varchar(255), _status int2, _status_info int4, _last_open_date timestamp without time zone, _title varchar(255), _user_index int4, _change_id int4, OUT isupdate char(5), OUT userindex int4) CASCADE; - CREATE OR REPLACE FUNCTION merge_db(_id varchar(255), _status int2, _status_info int4, _last_open_date timestamp without time zone, _title varchar(255), _user_index int4, _change_id int4, OUT isupdate char(5), OUT userindex int4) AS $$ DECLARE diff --git a/schema/postgresql/removetbl.sql b/schema/postgresql/removetbl.sql new file mode 100644 index 00000000..b97f34f6 --- /dev/null +++ b/schema/postgresql/removetbl.sql @@ -0,0 +1,10 @@ +-- +-- Drop tables +-- +DROP TABLE IF EXISTS "public"."doc_callbacks"; +DROP TABLE IF EXISTS "public"."doc_changes"; +DROP TABLE IF EXISTS "public"."task_result"; + +--https://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#PLPGSQL-UPSERT-EXAMPLE +DROP FUNCTION IF EXISTS merge_db(_id varchar(255), _status int2, _status_info int8, _last_open_date timestamp without time zone, _title varchar(255), _user_index int8, _change_id int8, OUT isupdate char(5), OUT userindex int8) CASCADE; +DROP FUNCTION IF EXISTS merge_db(_id varchar(255), _status int2, _status_info int4, _last_open_date timestamp without time zone, _title varchar(255), _user_index int4, _change_id int4, OUT isupdate char(5), OUT userindex int4) CASCADE;