From d943b74a843b7cfa9e2d393942bd0b3791d56daf Mon Sep 17 00:00:00 2001 From: Geo Halkiadakis Date: Tue, 28 Mar 2023 13:16:05 +0300 Subject: linkeysearch:/javascript new async functions for parallel run of slow proccesses --- javascript/freq.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'javascript/freq.js') diff --git a/javascript/freq.js b/javascript/freq.js index 86bba22..bf52008 100644 --- a/javascript/freq.js +++ b/javascript/freq.js @@ -19,13 +19,9 @@ // REQUIREMENTS //////////////////////////////////////////////////////////////////////////////// - var mysql = require('mysql'); - const fs = require('fs'); - const os = require('os'); - const {Storage} = require('@google-cloud/storage'); // import Google Cloud client library require('dotenv').config({ path: '../auth/.env' }) @@ -166,7 +162,7 @@ var main = () => { console.log("Connected!"); // SQL to get needed data - var sql = "SELECT count(pl.eys_code) as FREQuency,\ + var sql = "SELECT count(pl.eys_code)*5+SUM(dop.quantity) as FREQuency,\ pl.product_id as product_id,\ pb.brand_name,\ pl.barcode, pl.skl_code, pl.eys_code,\ -- cgit v1.2.3