Skip to content

Commit

Permalink
[preprocessor/folder] add function comments
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed May 29, 2024
1 parent b65b249 commit a43b3fd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions preprocessor/folder/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func initDbTableIfNotExists(connPool *pgxpool.Pool) error {
return nil
}

// ProjectQueryResult represents the result of a project metadata query
type ProjectQueryResult struct {
ProjectId *string
ProjectPath *string
Expand All @@ -53,6 +54,7 @@ type ProjectQueryResult struct {
AuthorIdentifier *string
}

// queryAllProjects queries all project metadata from the database
func queryAllProjects(connPool *pgxpool.Pool) ([]ProjectQueryResult, error) {
var result []ProjectQueryResult
rows, err := connPool.Query(
Expand Down
1 change: 1 addition & 0 deletions preprocessor/folder/database_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var FILE_STATUS_TABLE = `CREATE TABLE IF NOT EXISTS file_status (
CREATE INDEX IF NOT EXISTS idx_file_status_status ON file_status (status);
`

// schema for project_metadata table
var PROJECT_METADATA_TABLE = `CREATE TABLE IF NOT EXISTS project_metadata (
id BIGSERIAL PRIMARY KEY,
project_id TEXT UNIQUE NOT NULL,
Expand Down
1 change: 1 addition & 0 deletions preprocessor/folder/folder.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func scanSyncDirectory(subPath string) (fileList []string, dirList []string, err
return fileList, dirList, err
}

// watchLoop watches for file changes in a directory and checks if it should be handled
func watchLoop(w *fsnotify.Watcher, pgPool *pgxpool.Pool, dirPathToProject map[string]ProjectQueryResult) {
for {
select {
Expand Down

0 comments on commit a43b3fd

Please sign in to comment.