mirror of
https://github.com/gnmyt/myspeed.git
synced 2025-12-28 08:29:50 -06:00
Bug fixes
This commit is contained in:
@@ -89,7 +89,12 @@ module.exports.importTests = async (data) => {
|
||||
for (let entry of data) {
|
||||
if (entry.error === null) delete entry.error;
|
||||
if (entry.resultId === null) delete entry.resultId;
|
||||
|
||||
if (["custom", "auto"].includes(entry.type)) continue;
|
||||
if (!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$/.test(entry.created)) continue;
|
||||
|
||||
try {
|
||||
console.log(entry)
|
||||
await tests.create(entry);
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ module.exports = db.define("speedtests", {
|
||||
defaultValue: 0
|
||||
},
|
||||
created: {
|
||||
type: Sequelize.TIME,
|
||||
type: process.env.DB_TYPE === "mysql" ? Sequelize.STRING : Sequelize.TIME,
|
||||
defaultValue: Sequelize.NOW
|
||||
}
|
||||
}, {createdAt: false, updatedAt: false});
|
||||
Reference in New Issue
Block a user