verteilen-core 1.3.4 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,6 +9,7 @@ export declare class Project_Module {
|
|
|
9
9
|
ProjectJobCount(uuid: string): number;
|
|
10
10
|
PopulateProject(uuid: string): Project | undefined;
|
|
11
11
|
PopulateTask(uuid: string): Task | undefined;
|
|
12
|
-
CascadeDeleteProject(uuid: string): void;
|
|
12
|
+
CascadeDeleteProject(uuid: string, bind: boolean): void;
|
|
13
13
|
CascadeDeleteTask(uuid: string): void;
|
|
14
|
+
Delete_Database_Idle(uuid: string): Promise<void>;
|
|
14
15
|
}
|
|
@@ -42,14 +42,17 @@ class Project_Module {
|
|
|
42
42
|
}
|
|
43
43
|
return buffer;
|
|
44
44
|
}
|
|
45
|
-
CascadeDeleteProject(uuid) {
|
|
45
|
+
CascadeDeleteProject(uuid, bind) {
|
|
46
46
|
const p = this.memory.projects.find(p => p.uuid == uuid);
|
|
47
47
|
if (!p)
|
|
48
48
|
return;
|
|
49
49
|
p.tasks_uuid.forEach(t_uuid => {
|
|
50
50
|
this.CascadeDeleteTask(t_uuid);
|
|
51
51
|
});
|
|
52
|
+
const db = p.database_uuid;
|
|
52
53
|
this.loader.project.delete(p.uuid);
|
|
54
|
+
if (bind)
|
|
55
|
+
this.Delete_Database_Idle(db);
|
|
53
56
|
}
|
|
54
57
|
CascadeDeleteTask(uuid) {
|
|
55
58
|
const p = this.memory.tasks.find(p => p.uuid == uuid);
|
|
@@ -60,5 +63,13 @@ class Project_Module {
|
|
|
60
63
|
});
|
|
61
64
|
this.loader.task.delete(p.uuid);
|
|
62
65
|
}
|
|
66
|
+
async Delete_Database_Idle(uuid) {
|
|
67
|
+
return this.loader.project.load_all().then(() => {
|
|
68
|
+
const f = this.memory.projects.find(x => x.database_uuid == uuid);
|
|
69
|
+
if (f == undefined) {
|
|
70
|
+
this.loader.database.delete(uuid);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
63
74
|
}
|
|
64
75
|
exports.Project_Module = Project_Module;
|
package/package.json
CHANGED
|
@@ -59,13 +59,15 @@ export class Project_Module {
|
|
|
59
59
|
* Delete project related data and project itself
|
|
60
60
|
* @param uuid Project UUID
|
|
61
61
|
*/
|
|
62
|
-
CascadeDeleteProject(uuid:string){
|
|
62
|
+
CascadeDeleteProject(uuid:string, bind:boolean){
|
|
63
63
|
const p:Project | undefined = this.memory.projects.find(p=> p.uuid == uuid)
|
|
64
64
|
if(!p) return
|
|
65
65
|
p.tasks_uuid.forEach(t_uuid => {
|
|
66
66
|
this.CascadeDeleteTask(t_uuid)
|
|
67
67
|
})
|
|
68
|
+
const db = p.database_uuid
|
|
68
69
|
this.loader.project.delete(p.uuid)
|
|
70
|
+
if(bind) this.Delete_Database_Idle(db)
|
|
69
71
|
}
|
|
70
72
|
/**
|
|
71
73
|
* Delete Task related data and project itself
|
|
@@ -79,4 +81,16 @@ export class Project_Module {
|
|
|
79
81
|
})
|
|
80
82
|
this.loader.task.delete(p.uuid)
|
|
81
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Delete idle database
|
|
86
|
+
* @param uuid Database UUID
|
|
87
|
+
*/
|
|
88
|
+
async Delete_Database_Idle(uuid:string){
|
|
89
|
+
return this.loader.project.load_all().then(() => {
|
|
90
|
+
const f = this.memory.projects.find(x => x.database_uuid == uuid)
|
|
91
|
+
if(f == undefined){
|
|
92
|
+
this.loader.database.delete(uuid)
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
}
|
|
82
96
|
}
|