Skip to content

Commit

Permalink
changed chunk size
Browse files Browse the repository at this point in the history
  • Loading branch information
AVtheking committed Nov 26, 2023
1 parent 4ff3d32 commit c70d75c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion controllers/video_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const videoCtrl = {
}
const videoPath = req.query.path;
const videoSize = fs.statSync(videoPath).size;
const CHUNK_SIZE = 10 ** 6;
const CHUNK_SIZE = 10 ** 4;
const start = Number(range.replace(/\D/g, ""));
const end = Math.min(start + CHUNK_SIZE, videoSize - 1);
const remainingTime = Math.floor(
Expand Down
7 changes: 4 additions & 3 deletions models/user_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ const userSchema = new mongoose.Schema({
is_certified_educator: {
type: Boolean,
default: false,
}
},
});
userSchema.path("createdCourse").default([]);
userSchema.path("ownedCourse").default([]);
userSchema.path("createdCourse").default(() => []);
userSchema.path("ownedCourse").default(() => []);

const User = new mongoose.model("User", userSchema);
module.exports = User;

0 comments on commit c70d75c

Please sign in to comment.