diff --git a/Dockerfile b/Dockerfile index ce2a977..cfa0aad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,10 +3,8 @@ FROM node:10 WORKDIR /usr/src/app # Copy neccessary files COPY ./functions ./functions -COPY ./functions ./functions COPY ./firebase.json ./ COPY ./.firebaserc ./ -COPY ./.firebase ./ WORKDIR /usr/src/app/functions RUN npm i --only=production -g pm2@latest firebase-tools cross-env typescript RUN npm ci --only=production diff --git a/functions/src/app.ts b/functions/src/app.ts index 748ecb9..45a8d7a 100644 --- a/functions/src/app.ts +++ b/functions/src/app.ts @@ -16,17 +16,6 @@ app.use(express.json()); app.use(express.urlencoded({extended: false})); app.use(express.static(path.join(__dirname, 'public'))); -/** - * ------------- - * Test purposes - * ------------- - const testUpdater = new updater.Updater(null, null, ['covid-19', 'enfermedad'], functions.config().newsriver.key, 'es'); - app.get('/api', (req, res) => - testUpdater.request() - .then(it => res.json(it)) - ); - * --------------- - */ app.use(router); // catch 404 and forward to error handler app.use((req, res, next) => next(createError(404))); diff --git a/functions/src/updater.ts b/functions/src/updater.ts index abd7df6..344f031 100644 --- a/functions/src/updater.ts +++ b/functions/src/updater.ts @@ -47,6 +47,7 @@ export class Updater { .catch(ignored => { }); }) + .catch(err => console.warn(`Unable to update data due to exception: ${err}`)); } schedule(): NodeJS.Timer {