becca conversion WIP

This commit is contained in:
zadam
2021-05-02 19:59:16 +02:00
parent 77eac8f764
commit 273d4e0052
23 changed files with 136 additions and 116 deletions

View File

@@ -1,9 +1,10 @@
const scriptService = require('./script');
const repository = require('./repository');
const cls = require('./cls');
const sqlInit = require('./sql_init');
const config = require('./config');
const log = require('./log');
const sql = require("./sql");
const becca = require("./becca/becca");
function getRunAtHours(note) {
try {
@@ -17,8 +18,9 @@ function getRunAtHours(note) {
}
function runNotesWithLabel(runAttrValue) {
const notes = repository.getEntities(`
SELECT notes.*
// TODO: should be refactored into becca search
const noteIds = sql.getColumn(`
SELECT notes.noteId
FROM notes
JOIN attributes ON attributes.noteId = notes.noteId
AND attributes.isDeleted = 0
@@ -29,6 +31,8 @@ function runNotesWithLabel(runAttrValue) {
notes.type = 'code'
AND notes.isDeleted = 0`, [runAttrValue]);
const notes = becca.getNotes(noteIds);
const instanceName = config.General ? config.General.instanceName : null;
const currentHours = new Date().getHours();