Refactor to pre-generate task queue for performance, fix some refactoring errors, fix some model bugs
parent
fb93e902a8
commit
b9b0e63454
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Launch Program",
|
||||||
|
"skipFiles": [
|
||||||
|
"<node_internals>/**"
|
||||||
|
],
|
||||||
|
"program": "./bin/simulate",
|
||||||
|
"args": ["../seekseek/scraper-config/", "lcsc:normalizeProduct", "lcsc:product:C494972"],
|
||||||
|
"env": {
|
||||||
|
"DEBUG": "srap:backend:postgresql:*"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
module.exports.up = function(knex, Promise) {
|
||||||
|
return knex.schema
|
||||||
|
.alterTable("srap_tasks_in_progress", (table) => {
|
||||||
|
table.timestamp("started_at").alter().nullable().defaultTo(null);
|
||||||
|
table.boolean("started").notNullable().defaultTo(false);
|
||||||
|
})
|
||||||
|
.renameTable("srap_tasks_in_progress", "srap_queue");
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.down = function(knex, Promise) {
|
||||||
|
return knex.schema
|
||||||
|
.renameTable("srap_queue", "srap_tasks_in_progress")
|
||||||
|
.alterTable("srap_tasks_in_progress", (table) => {
|
||||||
|
table.timestamp("started_at").alter().notNullable().defaultTo(knex.fn.now());
|
||||||
|
table.dropColumn("started");
|
||||||
|
});
|
||||||
|
};
|
Loading…
Reference in New Issue