Skip to content

Commit

Permalink
Corrected unhandled exception on updater class
Browse files Browse the repository at this point in the history
  • Loading branch information
Javinator9889 committed Jun 9, 2020
1 parent 3bc7d59 commit e4d6d4b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 0 additions & 11 deletions functions/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down
1 change: 1 addition & 0 deletions functions/src/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export class Updater {
.catch(ignored => {
});
})
.catch(err => console.warn(`Unable to update data due to exception: ${err}`));
}

schedule(): NodeJS.Timer {
Expand Down

0 comments on commit e4d6d4b

Please sign in to comment.