<commit_before>'use strict';

import React from 'react';

class Footer extends React.Component {
  constructor() {
    super();
    this.state = {};
  }

  componentDidMount() {
    this.updateInfo();
    this.interval = setInterval(this.updateInfo.bind(this), 10000);
  }

  componentWillReceiveProps(nextProps) {
    if (nextProps.db !== this.props.db) {
      this.updateInfo();
    }
  }

  updateInfo() {
    this.props.redis.info((err, res) => {
      const info = {};
<commit_msg>fix: check err first before update the database status<commit_after>'use strict';

import React from 'react';

class Footer extends React.Component {
  constructor() {
    super();
    this.state = {};
  }

  componentDidMount() {
    this.updateInfo();
    this.interval = setInterval(this.updateInfo.bind(this), 10000);
  }

  componentWillReceiveProps(nextProps) {
    if (nextProps.db !== this.props.db) {
      this.updateInfo();
    }
  }

  updateInfo() {
    this.props.redis.info((err, res) => {
      if (err) {
        return;
      }
      const info = {};

{'fraction_non_alphanumeric': 0.14962121212121213, 'fraction_numerical': 0.00946969696969697, 'mean_word_length': 2.914814814814815, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4552638', 'n_tokens_mistral': 352, 'n_tokens_neox': 333, 'n_words': 67}