diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 92a423b..8a2cd12 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -5,7 +5,6 @@ on: branches: - main - dev - - v1.0 jobs: build: @@ -48,18 +47,12 @@ jobs: - name: Push Docker image run: | - # If on v1.0 branch, push to 'testingv1.0' tag - if [[ "${{ github.ref }}" == "refs/heads/v1.0" ]]; then - docker tag ti1:${{ env.VERSION }} ${{ secrets.DOCKER_USERNAME }}/ti1:testingv1.0 - docker push ${{ secrets.DOCKER_USERNAME }}/ti1:testingv1.0 - else - # Always push to 'dev' tag for main and dev branches - docker tag ti1:${{ env.VERSION }} ${{ secrets.DOCKER_USERNAME }}/ti1:dev - docker push ${{ secrets.DOCKER_USERNAME }}/ti1:dev + # Always push to 'dev' tag + docker tag ti1:${{ env.VERSION }} ${{ secrets.DOCKER_USERNAME }}/ti1:dev + docker push ${{ secrets.DOCKER_USERNAME }}/ti1:dev - # If the version is valid, also push that specific version tag - if [[ "${{ env.VERSION }}" != "dev" ]]; then - docker tag ti1:${{ env.VERSION }} ${{ secrets.DOCKER_USERNAME }}/ti1:${{ env.VERSION }} - docker push ${{ secrets.DOCKER_USERNAME }}/ti1:${{ env.VERSION }} - fi - fi + # If the version is valid, also push that specific version tag + if [[ "${{ env.VERSION }}" != "dev" ]]; then + docker tag ti1:${{ env.VERSION }} ${{ secrets.DOCKER_USERNAME }}/ti1:${{ env.VERSION }} + docker push ${{ secrets.DOCKER_USERNAME }}/ti1:${{ env.VERSION }} + fi \ No newline at end of file diff --git a/export/database.go b/export/database.go index c5871af..db5eaa2 100644 --- a/export/database.go +++ b/export/database.go @@ -11,6 +11,7 @@ import ( "ti1/config" "ti1/data" "ti1/database" + "time" ) // DBData is the main entry point for data processing @@ -45,6 +46,9 @@ func DBDataOptimized(data *data.Data) { } fmt.Println("SID:", sid) + // Record start time + startTime := time.Now() + // Atomic counters for thread-safe counting var insertCount, updateCount, estimatedCallInsertCount, estimatedCallUpdateCount, estimatedCallNoneCount, recordedCallInsertCount, recordedCallUpdateCount, recordedCallNoneCount int64 @@ -444,6 +448,9 @@ func DBDataOptimized(data *data.Data) { close(recordedCallJobs) callWg.Wait() + // Record end time + endTime := time.Now() + // Print final stats fmt.Printf( "\nDONE: EVJ - Inserts: %d, Updates: %d, Total: %d\n"+ @@ -470,6 +477,9 @@ func DBDataOptimized(data *data.Data) { serviceDeliveryJsonObject["RecordedCallInserts"] = atomic.LoadInt64(&recordedCallInsertCount) serviceDeliveryJsonObject["RecordedCallUpdates"] = atomic.LoadInt64(&recordedCallUpdateCount) serviceDeliveryJsonObject["RecordedCallNone"] = atomic.LoadInt64(&recordedCallNoneCount) + serviceDeliveryJsonObject["StartTime"] = startTime.Format(time.RFC3339) + serviceDeliveryJsonObject["EndTime"] = endTime.Format(time.RFC3339) + serviceDeliveryJsonObject["Duration"] = endTime.Sub(startTime).String() // Convert JSON object to JSON string serviceDeliveryJsonString, err := json.Marshal(serviceDeliveryJsonObject) diff --git a/main.go b/main.go index cdd201a..c8b9158 100644 --- a/main.go +++ b/main.go @@ -9,7 +9,7 @@ import ( ) func main() { - log.Println("ti1 testing v1.0.0") + log.Println("ti1 testing v1.0.2") log.Println("Starting...") // Setup the database